From 7a7ce701692d4048a7f5ab2767aa30a8f5eb05c8 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 19 May 2015 20:46:48 -0700 Subject: Use the user list from the target project in a merge request Closes #1535 --- features/project/forked_merge_requests.feature | 12 ++++++++++++ features/steps/project/forked_merge_requests.rb | 15 +++++++++++++++ 2 files changed, 27 insertions(+) (limited to 'features') diff --git a/features/project/forked_merge_requests.feature b/features/project/forked_merge_requests.feature index d9fbb875c28..ad1160e3343 100644 --- a/features/project/forked_merge_requests.feature +++ b/features/project/forked_merge_requests.feature @@ -38,3 +38,15 @@ Feature: Project Forked Merge Requests Given I visit project "Forked Shop" merge requests page And I click link "New Merge Request" Then the target repository should be the original repository + + @javascript + Scenario: I see the users in the target project for a new merge request + Given I logout + And I sign in as an admin + And I have a project forked off of "Shop" called "Forked Shop" + Then I visit project "Forked Shop" merge requests page + And I click link "New Merge Request" + And I fill out a "Merge Request On Forked Project" merge request + When I click "Assign to" dropdown" + Then I should see the target project ID in the input selector + And I should see the users from the target project ID diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 94d21d28a0c..ebfa102cee5 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -128,6 +128,21 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps page.should have_select("merge_request_target_project_id", selected: @project.path_with_namespace) end + step 'I click "Assign to" dropdown"' do + first('.ajax-users-select').click + end + + step 'I should see the target project ID in the input selector' do + expect(page).to have_selector("input[data-project-id=\"#{@project.id}\"]") + end + + step 'I should see the users from the target project ID' do + expect(page).to have_selector('.user-result', visible: true, count: 2) + users = page.all('.user-name') + users[0].text.should == 'Unassigned' + users[1].text.should == @project.users.first.name + end + # Verify a link is generated against the correct project def verify_commit_link(container_div, container_project) # This should force a wait for the javascript to execute -- cgit v1.2.1