diff options
author | Andrey Kumanyaev <me@zzet.org> | 2012-12-26 02:52:20 +0400 |
---|---|---|
committer | Andrey Kumanyaev <me@zzet.org> | 2012-12-26 19:52:15 +0400 |
commit | 9c574464a6051536ee83a93e8270a7dd9d85da33 (patch) | |
tree | 306ca832f425920b8ccfbff150dacb5e39359e4d /features | |
parent | 17ea019f4e43b4fb394544f9d86ab3016f54d28e (diff) |
Add functional in admin section
Diffstat (limited to 'features')
-rw-r--r-- | features/admin/groups.feature | 7 | ||||
-rw-r--r-- | features/steps/admin/admin_groups.rb | 38 |
2 files changed, 45 insertions, 0 deletions
diff --git a/features/admin/groups.feature b/features/admin/groups.feature index e5eab8e6ecb..28f35e3a831 100644 --- a/features/admin/groups.feature +++ b/features/admin/groups.feature @@ -1,6 +1,8 @@ Feature: Admin Groups Background: Given I sign in as an admin + And I have group with projects + And Create gitlab user "John" And I visit admin groups page Scenario: Create a group @@ -8,3 +10,8 @@ Feature: Admin Groups And submit form with new group info Then I should be redirected to group page And I should see newly created group + + Scenario: Add user into projects in group + When I visit admin group page + When I select user "John" from user list as "Reporter" + Then I should see "John" in team list in every project as "Reporter" diff --git a/features/steps/admin/admin_groups.rb b/features/steps/admin/admin_groups.rb index 5386f473320..0271348eb1d 100644 --- a/features/steps/admin/admin_groups.rb +++ b/features/steps/admin/admin_groups.rb @@ -3,10 +3,26 @@ class AdminGroups < Spinach::FeatureSteps include SharedPaths include SharedActiveTab + When 'I visit admin group page' do + visit admin_group_path(current_group) + end + When 'I click new group link' do click_link "New Group" end + And 'I have group with projects' do + @group = create(:group) + @project = create(:project, group: @group) + @event = create(:closed_issue_event, project: @project) + + @project.add_access current_user, :admin + end + + And 'Create gitlab user "John"' do + create(:user, :name => "John") + end + And 'submit form with new group info' do fill_in 'group_name', :with => 'gitlab' click_button "Create group" @@ -19,5 +35,27 @@ class AdminGroups < Spinach::FeatureSteps Then 'I should be redirected to group page' do current_path.should == admin_group_path(Group.last) end + + When 'I select user "John" from user list as "Reporter"' do + user = User.find_by_name("John") + within "#new_team_member" do + select user.name, :from => "user_ids" + select "Reporter", :from => "project_access" + end + click_button "Add user to projects in group" + end + + Then 'I should see "John" in team list in every project as "Reporter"' do + user = User.find_by_name("John") + projects_with_access = find(".user_#{user.id} .projects_access") + projects_with_access.should have_link("Reporter") + end + + protected + + def current_group + @group ||= Group.first + end + end |