summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-24 22:27:01 +0100
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-25 10:24:29 +0100
commitea7467d2be0e367ed1ec6df656cab059a9db6da0 (patch)
tree18dbdb082000a393302d6ab225c81aea1af59294 /features
parent34cc8f4a60f25bfa2503f0ad006b047fd2c2f81c (diff)
downloadgitlab-ce-ea7467d2be0e367ed1ec6df656cab059a9db6da0.tar.gz
Refactor group members tests a bit
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'features')
-rw-r--r--features/groups.feature3
-rw-r--r--features/project/team_management.feature6
-rw-r--r--features/steps/groups.rb29
-rw-r--r--features/steps/project/team_management.rb4
4 files changed, 15 insertions, 27 deletions
diff --git a/features/groups.feature b/features/groups.feature
index 938e658f2a9..65ced5c529d 100644
--- a/features/groups.feature
+++ b/features/groups.feature
@@ -55,7 +55,6 @@ Feature: Groups
Scenario: Add user to group
Given gitlab user "Mike"
When I visit group "Owned" members page
- And I click link "Add members"
When I select "Mike" as "Reporter"
Then I should see "Mike" in team list as "Reporter"
@@ -63,14 +62,12 @@ Feature: Groups
Scenario: Ignore add user to group when is already Owner
Given gitlab user "Mike"
When I visit group "Owned" members page
- And I click link "Add members"
When I select "Mike" as "Reporter"
Then I should see "Mike" in team list as "Owner"
@javascript
Scenario: Invite user to group
When I visit group "Owned" members page
- And I click link "Add members"
When I select "sjobs@apple.com" as "Reporter"
Then I should see "sjobs@apple.com" in team list as invited "Reporter"
diff --git a/features/project/team_management.feature b/features/project/team_management.feature
index 09a7df59df6..06fb45c8bde 100644
--- a/features/project/team_management.feature
+++ b/features/project/team_management.feature
@@ -13,14 +13,12 @@ Feature: Project Team Management
@javascript
Scenario: Add user to project
- Given I click link "Add members"
- And I select "Mike" as "Reporter"
+ When I select "Mike" as "Reporter"
Then I should see "Mike" in team list as "Reporter"
@javascript
Scenario: Invite user to project
- Given I click link "Add members"
- And I select "sjobs@apple.com" as "Reporter"
+ When I select "sjobs@apple.com" as "Reporter"
Then I should see "sjobs@apple.com" in team list as invited "Reporter"
@javascript
diff --git a/features/steps/groups.rb b/features/steps/groups.rb
index 7c991af4c2b..5de54d9b1ee 100644
--- a/features/steps/groups.rb
+++ b/features/steps/groups.rb
@@ -13,10 +13,6 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
create(:user, name: "Mike")
end
- step 'I click link "Add members"' do
- find(:css, 'button.btn-new').click
- end
-
step 'I should see group "Owned"' do
expect(page).to have_content '@owned'
end
@@ -60,14 +56,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see "Mike" in team list as "Reporter"' do
- page.within '.well-list' do
+ page.within '.content-list' do
expect(page).to have_content('Mike')
expect(page).to have_content('Reporter')
end
end
step 'I should see "Mike" in team list as "Owner"' do
- page.within '.well-list' do
+ page.within '.content-list' do
expect(page).to have_content('Mike')
expect(page).to have_content('Owner')
end
@@ -83,7 +79,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
end
step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do
- page.within '.well-list' do
+ page.within '.content-list' do
expect(page).to have_content('sjobs@apple.com')
expect(page).to have_content('invited')
expect(page).to have_content('Reporter')
@@ -114,32 +110,29 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
step 'I select user "Mary Jane" from list with role "Reporter"' do
user = User.find_by(name: "Mary Jane") || create(:user, name: "Mary Jane")
- click_button 'Add members'
+
page.within ".users-group-form" do
select2(user.id, from: "#user_ids", multiple: true)
select "Reporter", from: "access_level"
end
+
click_button "Add users to group"
end
step 'I should see user "John Doe" in team list' do
- projects_with_access = find(".panel .well-list")
- expect(projects_with_access).to have_content("John Doe")
+ expect(group_members_list).to have_content("John Doe")
end
step 'I should not see user "John Doe" in team list' do
- projects_with_access = find(".panel .well-list")
- expect(projects_with_access).not_to have_content("John Doe")
+ expect(group_members_list).not_to have_content("John Doe")
end
step 'I should see user "Mary Jane" in team list' do
- projects_with_access = find(".panel .well-list")
- expect(projects_with_access).to have_content("Mary Jane")
+ expect(group_members_list).to have_content("Mary Jane")
end
step 'I should not see user "Mary Jane" in team list' do
- projects_with_access = find(".panel .well-list")
- expect(projects_with_access).not_to have_content("Mary Jane")
+ expect(group_members_list).not_to have_content("Mary Jane")
end
step 'project from group "Owned" has issues assigned to me' do
@@ -401,4 +394,8 @@ class Spinach::Features::Groups < Spinach::FeatureSteps
author: current_user,
milestone: milestone2_project3
end
+
+ def group_members_list
+ find(".panel .content-list")
+ end
end
diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb
index 97d63016458..caad52def79 100644
--- a/features/steps/project/team_management.rb
+++ b/features/steps/project/team_management.rb
@@ -15,10 +15,6 @@ class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps
expect(page).to have_content(user.username)
end
- step 'I click link "Add members"' do
- find(:css, 'button.btn-new').click
- end
-
step 'I select "Mike" as "Reporter"' do
user = User.find_by(name: "Mike")