diff options
Diffstat (limited to 'spec/features/merge_requests')
-rw-r--r-- | spec/features/merge_requests/user_lists_merge_requests_spec.rb | 87 | ||||
-rw-r--r-- | spec/features/merge_requests/user_views_open_merge_requests_spec.rb | 10 |
2 files changed, 54 insertions, 43 deletions
diff --git a/spec/features/merge_requests/user_lists_merge_requests_spec.rb b/spec/features/merge_requests/user_lists_merge_requests_spec.rb index 371c40b40a5..f594e39b2b7 100644 --- a/spec/features/merge_requests/user_lists_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_lists_merge_requests_spec.rb @@ -14,44 +14,52 @@ RSpec.describe 'Merge requests > User lists merge requests', feature_category: : let(:user5) { create(:user) } before do - @fix = create(:merge_request, - title: 'fix', - source_project: project, - source_branch: 'fix', - assignees: [user], - reviewers: [user, user2, user3, user4, user5], - milestone: create(:milestone, project: project, due_date: '2013-12-11'), - created_at: 1.minute.ago, - updated_at: 1.minute.ago) + @fix = create( + :merge_request, + title: 'fix', + source_project: project, + source_branch: 'fix', + assignees: [user], + reviewers: [user, user2, user3, user4, user5], + milestone: create(:milestone, project: project, due_date: '2013-12-11'), + created_at: 1.minute.ago, + updated_at: 1.minute.ago + ) @fix.metrics.update!(merged_at: 10.seconds.ago, latest_closed_at: 20.seconds.ago) - @markdown = create(:merge_request, - title: 'markdown', - source_project: project, - source_branch: 'markdown', - assignees: [user], - reviewers: [user, user2, user3, user4], - milestone: create(:milestone, project: project, due_date: '2013-12-12'), - created_at: 2.minutes.ago, - updated_at: 2.minutes.ago, - state: 'merged') + @markdown = create( + :merge_request, + title: 'markdown', + source_project: project, + source_branch: 'markdown', + assignees: [user], + reviewers: [user, user2, user3, user4], + milestone: create(:milestone, project: project, due_date: '2013-12-12'), + created_at: 2.minutes.ago, + updated_at: 2.minutes.ago, + state: 'merged' + ) @markdown.metrics.update!(merged_at: 10.minutes.ago, latest_closed_at: 10.seconds.ago) - @merge_test = create(:merge_request, - title: 'merge-test', - source_project: project, - source_branch: 'merge-test', - created_at: 3.minutes.ago, - updated_at: 10.seconds.ago) + @merge_test = create( + :merge_request, + title: 'merge-test', + source_project: project, + source_branch: 'merge-test', + created_at: 3.minutes.ago, + updated_at: 10.seconds.ago + ) @merge_test.metrics.update!(merged_at: 10.seconds.ago, latest_closed_at: 10.seconds.ago) - @feature = create(:merge_request, - title: 'feature', - source_project: project, - source_branch: 'feautre', - created_at: 2.minutes.ago, - updated_at: 1.minute.ago, - state: 'merged') + @feature = create( + :merge_request, + title: 'feature', + source_project: project, + source_branch: 'feautre', + created_at: 2.minutes.ago, + updated_at: 1.minute.ago, + state: 'merged' + ) @feature.metrics.update!(merged_at: 10.seconds.ago, latest_closed_at: 10.minutes.ago) end @@ -134,8 +142,7 @@ RSpec.describe 'Merge requests > User lists merge requests', feature_category: : label = create(:label, project: project) create(:label_link, label: label, target: @fix) - visit_merge_requests(project, label_name: [label.name], - sort: sort_value_milestone) + visit_merge_requests(project, label_name: [label.name], sort: sort_value_milestone) expect(first_merge_request).to include('fix') expect(count_merge_requests).to eq(1) @@ -160,8 +167,7 @@ RSpec.describe 'Merge requests > User lists merge requests', feature_category: : end it 'sorts by milestone due date' do - visit_merge_requests(project, label_name: [label.name, label2.name], - sort: sort_value_milestone) + visit_merge_requests(project, label_name: [label.name, label2.name], sort: sort_value_milestone) expect(first_merge_request).to include('fix') expect(count_merge_requests).to eq(1) @@ -169,9 +175,12 @@ RSpec.describe 'Merge requests > User lists merge requests', feature_category: : context 'filter on assignee and' do it 'sorts by milestone due date' do - visit_merge_requests(project, label_name: [label.name, label2.name], - assignee_id: user.id, - sort: sort_value_milestone) + visit_merge_requests( + project, + label_name: [label.name, label2.name], + assignee_id: user.id, + sort: sort_value_milestone + ) expect(first_merge_request).to include('fix') expect(count_merge_requests).to eq(1) diff --git a/spec/features/merge_requests/user_views_open_merge_requests_spec.rb b/spec/features/merge_requests/user_views_open_merge_requests_spec.rb index 1a2024a5511..0021f701290 100644 --- a/spec/features/merge_requests/user_views_open_merge_requests_spec.rb +++ b/spec/features/merge_requests/user_views_open_merge_requests_spec.rb @@ -57,10 +57,12 @@ RSpec.describe 'User views open merge requests', feature_category: :code_review_ let!(:build) { create :ci_build, pipeline: pipeline } let(:merge_request) do - create(:merge_request_with_diffs, - source_project: project, - target_project: project, - source_branch: 'merge-test') + create( + :merge_request_with_diffs, + source_project: project, + target_project: project, + source_branch: 'merge-test' + ) end let(:pipeline) do |