diff options
author | winniehell <git@winniehell.de> | 2017-02-13 01:49:29 +0300 |
---|---|---|
committer | winniehell <git@winniehell.de> | 2017-02-13 02:29:39 +0300 |
commit | fc7d2a88f4256a68eb884981fcc2dd99febaa668 (patch) | |
tree | 4c8a00c52eefac7d6440c0a9b7f3fa28c0d226e5 /spec/javascripts/fixtures/merge_requests.rb | |
parent | 8a1441fb025bf9f46d42017e069382a44ade28d0 (diff) |
Replace static fixture for merge_request_tabs_spec.js (!9172)
Diffstat (limited to 'spec/javascripts/fixtures/merge_requests.rb')
-rw-r--r-- | spec/javascripts/fixtures/merge_requests.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/javascripts/fixtures/merge_requests.rb b/spec/javascripts/fixtures/merge_requests.rb new file mode 100644 index 00000000000..62984097099 --- /dev/null +++ b/spec/javascripts/fixtures/merge_requests.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :controller do + include JavaScriptFixturesHelpers + + let(:admin) { create(:admin) } + let(:namespace) { create(:namespace, name: 'frontend-fixtures' )} + let(:project) { create(:project, namespace: namespace, path: 'merge-requests-project') } + + render_views + + before(:all) do + clean_frontend_fixtures('merge_requests/') + end + + before(:each) do + sign_in(admin) + end + + it 'merge_requests/merge_request_with_task_list.html.raw' do |example| + merge_request = create(:merge_request, :with_diffs, source_project: project, target_project: project, description: '- [ ] Task List Item') + render_merge_request(example.description, merge_request) + end + + private + + def render_merge_request(fixture_file_name, merge_request) + get :show, + namespace_id: project.namespace.to_param, + project_id: project.to_param, + id: merge_request.to_param + + expect(response).to be_success + store_frontend_fixture(response, fixture_file_name) + end +end |