diff options
author | Rémy Coutable <remy@rymai.me> | 2017-06-26 17:17:20 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-06-26 17:17:20 +0000 |
commit | dfe689a7691c9bf681b704128191584d75832d33 (patch) | |
tree | ae74e870b6e56a74a902f9026b115eb9129746d2 /features | |
parent | 4988c3a8740324fbc7e66e67a8373d783f9c1ae4 (diff) | |
parent | a7ccf27d28e84ebe889b7d8f6bdd5f04a751fd3c (diff) | |
download | gitlab-ce-dfe689a7691c9bf681b704128191584d75832d33.tar.gz |
Merge branch '23036-replace-dashboard-mr-spinach' into 'master'
Replace 'dashboard/merge_requests' spinach with rspec
See merge request !12440
Diffstat (limited to 'features')
-rw-r--r-- | features/dashboard/merge_requests.feature | 21 | ||||
-rw-r--r-- | features/steps/dashboard/merge_requests.rb | 121 |
2 files changed, 0 insertions, 142 deletions
diff --git a/features/dashboard/merge_requests.feature b/features/dashboard/merge_requests.feature deleted file mode 100644 index 4a2c997d707..00000000000 --- a/features/dashboard/merge_requests.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Merge Requests - Background: - Given I sign in as a user - And I have authored merge requests - And I have assigned merge requests - And I have other merge requests - And I visit dashboard merge requests page - - Scenario: I should see assigned merge_requests - Then I should see merge requests assigned to me - - @javascript - Scenario: I should see authored merge_requests - When I click "Authored by me" link - Then I should see merge requests authored by me - - @javascript - Scenario: I should see all merge_requests - When I click "All" link - Then I should see all merge requests diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb deleted file mode 100644 index 909ffec3646..00000000000 --- a/features/steps/dashboard/merge_requests.rb +++ /dev/null @@ -1,121 +0,0 @@ -class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include Select2Helper - - step 'I should see merge requests assigned to me' do - should_see(assigned_merge_request) - should_see(assigned_merge_request_from_fork) - should_not_see(authored_merge_request) - should_not_see(authored_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see merge requests authored by me' do - should_see(authored_merge_request) - should_see(authored_merge_request_from_fork) - should_not_see(assigned_merge_request) - should_not_see(assigned_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see all merge requests' do - should_see(authored_merge_request) - should_see(assigned_merge_request) - should_see(other_merge_request) - end - - step 'I have authored merge requests' do - authored_merge_request - authored_merge_request_from_fork - end - - step 'I have assigned merge requests' do - assigned_merge_request - assigned_merge_request_from_fork - end - - step 'I have other merge requests' do - other_merge_request - end - - step 'I click "Authored by me" link' do - find("#assignee_id").set("") - find(".js-author-search", match: :first).click - find(".dropdown-menu-author li a", match: :first, text: current_user.to_reference).click - end - - step 'I click "All" link' do - find(".js-author-search").click - expect(page).to have_selector(".dropdown-menu-author li a") - find(".dropdown-menu-author li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-author li a") - - find(".js-assignee-search").click - expect(page).to have_selector(".dropdown-menu-assignee li a") - find(".dropdown-menu-assignee li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-assignee li a") - end - - def should_see(merge_request) - expect(page).to have_content(merge_request.title[0..10]) - end - - def should_not_see(merge_request) - expect(page).not_to have_content(merge_request.title[0..10]) - end - - def assigned_merge_request - @assigned_merge_request ||= create :merge_request, - assignee: current_user, - target_project: project, - source_project: project - end - - def authored_merge_request - @authored_merge_request ||= create :merge_request, - source_branch: 'markdown', - author: current_user, - target_project: project, - source_project: project - end - - def other_merge_request - @other_merge_request ||= create :merge_request, - source_branch: 'fix', - target_project: project, - source_project: project - end - - def authored_merge_request_from_fork - @authored_merge_request_from_fork ||= create :merge_request, - source_branch: 'feature_conflict', - author: current_user, - target_project: public_project, - source_project: forked_project - end - - def assigned_merge_request_from_fork - @assigned_merge_request_from_fork ||= create :merge_request, - source_branch: 'markdown', - assignee: current_user, - target_project: public_project, - source_project: forked_project - end - - def project - @project ||= begin - project = create(:project, :repository) - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create(:project, :public, :repository) - end - - def forked_project - @forked_project ||= Projects::ForkService.new(public_project, current_user).execute - end -end |