Commit 3ee2226b authored by Winnie Hellmann's avatar Winnie Hellmann

Remove unused fixture_file_name parameters

for f in $(find spec/javascripts/fixtures/ -name '*.rb')
do
  sed -E -e 's/(, ){0,1}(fixture_file_name|
  example\.description)(, ){0,1}//' < $f > $f.tmp; mv $f.tmp $f
done
parent d4bde862
......@@ -22,22 +22,22 @@ describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller
end
it 'issues/open-issue.html' do
render_issue(example.description, create(:issue, project: project))
render_issue(create(:issue, project: project))
end
it 'issues/closed-issue.html' do
render_issue(example.description, create(:closed_issue, project: project))
render_issue(create(:closed_issue, project: project))
end
it 'issues/issue-with-task-list.html' do
issue = create(:issue, project: project, description: '- [ ] Task List Item')
render_issue(example.description, issue)
render_issue(issue)
end
it 'issues/issue_with_comment.html' do
issue = create(:issue, project: project)
create(:note, project: project, noteable: issue, note: '- [ ] Task List Item').save
render_issue(example.description, issue)
render_issue(issue)
end
it 'issues/issue_list.html' do
......@@ -53,7 +53,7 @@ describe Projects::IssuesController, '(JavaScript fixtures)', type: :controller
private
def render_issue(fixture_file_name, issue)
def render_issue(issue)
get :show, params: {
namespace_id: project.namespace.to_param,
project_id: project,
......
......@@ -45,13 +45,13 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
it 'merge_requests/merge_request_of_current_user.html' do
merge_request.update(author: admin)
render_merge_request(example.description, merge_request)
render_merge_request(merge_request)
end
it 'merge_requests/merge_request_with_task_list.html' do
create(:ci_build, :pending, pipeline: pipeline)
render_merge_request(example.description, merge_request)
render_merge_request(merge_request)
end
it 'merge_requests/merged_merge_request.html' do
......@@ -59,35 +59,35 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
allow(merge_request).to receive(:source_branch_exists?).and_return(true)
allow(merge_request).to receive(:can_remove_source_branch?).and_return(true)
end
render_merge_request(example.description, merged_merge_request)
render_merge_request(merged_merge_request)
end
it 'merge_requests/diff_comment.html' do
create(:diff_note_on_merge_request, project: project, author: admin, position: position, noteable: merge_request)
create(:note_on_merge_request, author: admin, project: project, noteable: merge_request)
render_merge_request(example.description, merge_request)
render_merge_request(merge_request)
end
it 'merge_requests/merge_request_with_comment.html' do
create(:note_on_merge_request, author: admin, project: project, noteable: merge_request, note: '- [ ] Task List Item')
render_merge_request(example.description, merge_request)
render_merge_request(merge_request)
end
it 'merge_requests/discussions.json' do
create(:diff_note_on_merge_request, project: project, author: admin, position: position, noteable: merge_request)
render_discussions_json(merge_request, example.description)
render_discussions_json(merge_request)
end
it 'merge_requests/diff_discussion.json' do
create(:diff_note_on_merge_request, project: project, author: admin, position: position, noteable: merge_request)
render_discussions_json(merge_request, example.description)
render_discussions_json(merge_request)
end
it 'merge_requests/resolved_diff_discussion.json' do
note = create(:discussion_note_on_merge_request, :resolved, project: project, author: admin, position: position, noteable: merge_request)
create(:system_note, project: project, author: admin, noteable: merge_request, discussion_id: note.discussion.id)
render_discussions_json(merge_request, example.description)
render_discussions_json(merge_request)
end
context 'with image diff' do
......@@ -108,13 +108,13 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
it 'merge_requests/image_diff_discussion.json' do
create(:diff_note_on_merge_request, project: project, noteable: merge_request2, position: image_position)
render_discussions_json(merge_request2, example.description)
render_discussions_json(merge_request2)
end
end
private
def render_discussions_json(merge_request, fixture_file_name)
def render_discussions_json(merge_request)
get :discussions, params: {
namespace_id: project.namespace.to_param,
project_id: project,
......@@ -123,7 +123,7 @@ describe Projects::MergeRequestsController, '(JavaScript fixtures)', type: :cont
end
def render_merge_request(fixture_file_name, merge_request)
def render_merge_request(merge_request)
get :show, params: {
namespace_id: project.namespace.to_param,
project_id: project,
......
......@@ -39,24 +39,24 @@ describe Projects::MergeRequests::DiffsController, '(JavaScript fixtures)', type
# This is so that the "author" information will be populated
create(:user, email: selected_commit.author_email, name: selected_commit.author_name)
render_merge_request(example.description, merge_request, commit_id: selected_commit.sha)
render_merge_request(merge_request, commit_id: selected_commit.sha)
end
it 'merge_request_diffs/inline_changes_tab_with_comments.json' do
create(:diff_note_on_merge_request, project: project, author: admin, position: position, noteable: merge_request)
create(:note_on_merge_request, author: admin, project: project, noteable: merge_request)
render_merge_request(example.description, merge_request)
render_merge_request(merge_request)
end
it 'merge_request_diffs/parallel_changes_tab_with_comments.json' do
create(:diff_note_on_merge_request, project: project, author: admin, position: position, noteable: merge_request)
create(:note_on_merge_request, author: admin, project: project, noteable: merge_request)
render_merge_request(example.description, merge_request, view: 'parallel')
render_merge_request(merge_request, view: 'parallel')
end
private
def render_merge_request(fixture_file_name, merge_request, view: 'inline', **extra_params)
def render_merge_request(merge_request, view: 'inline', **extra_params)
get :show, params: {
namespace_id: project.namespace.to_param,
project_id: project,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment