summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-03-30 23:53:42 -0700
committerStan Hu <stanhu@gmail.com>2015-04-09 01:04:53 -0700
commit3d2c3878408bd27af64293a22eff6857ad9b38dd (patch)
tree13e35e9024d7998d1c164c8a288562b3465d013f /features
parentf3f856029bc5f966c5a7ee24cf7efefdd20e6019 (diff)
downloadgitlab-ce-3d2c3878408bd27af64293a22eff6857ad9b38dd.tar.gz
Move current user to the top of the list in author/assignee filters
Closes #1321
Diffstat (limited to 'features')
-rw-r--r--features/project/issues/issues.feature6
-rw-r--r--features/steps/project/issues/issues.rb12
-rw-r--r--features/steps/shared/project.rb7
3 files changed, 25 insertions, 0 deletions
diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature
index af01c7058ea..eb813884d1e 100644
--- a/features/project/issues/issues.feature
+++ b/features/project/issues/issues.feature
@@ -25,6 +25,12 @@ Feature: Project Issues
Given I click link "Release 0.4"
Then I should see issue "Release 0.4"
+ @javascript
+ Scenario: I visit issue page
+ Given I add a user to project "Shop"
+ And I click "author" dropdown
+ Then I see current user as the first user
+
Scenario: I submit new unassigned issue
Given I click link "New Issue"
And I submit new issue "500 error on profile"
diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb
index e2834d51a27..b8e282b2029 100644
--- a/features/steps/project/issues/issues.rb
+++ b/features/steps/project/issues/issues.rb
@@ -59,6 +59,18 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
click_link "New Issue"
end
+ step 'I click "author" dropdown' do
+ first('.ajax-users-select').click
+ end
+
+ step 'I see current user as the first user' do
+ expect(page).to have_selector('.user-result', visible: true, count: 4)
+ users = page.all('.user-name')
+ users[0].text.should == 'Any'
+ users[1].text.should == 'Unassigned'
+ users[2].text.should == current_user.name
+ end
+
step 'I submit new issue "500 error on profile"' do
fill_in "issue_title", with: "500 error on profile"
click_button "Submit new issue"
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index 41f71ae29cb..b60ac5e3423 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -14,6 +14,13 @@ module SharedProject
@project.team << [@user, :master]
end
+ # Add another user to project "Shop"
+ step 'I add a user to project "Shop"' do
+ @project = Project.find_by(name: "Shop")
+ other_user = create(:user, name: 'Alpha')
+ @project.team << [other_user, :master]
+ end
+
# Create another specific project called "Forum"
step 'I own project "Forum"' do
@project = Project.find_by(name: "Forum")