gitlab-org--gitlab-foss/features/steps/admin/groups.rb

67 lines
1.7 KiB
Ruby
Raw Normal View History

2012-10-22 14:42:06 -04:00
class AdminGroups < Spinach::FeatureSteps
include SharedAuthentication
include SharedPaths
include SharedUser
2012-10-22 14:42:06 -04:00
include SharedActiveTab
include Select2Helper
2012-10-22 14:42:06 -04:00
2012-12-25 17:52:20 -05:00
When 'I visit admin group page' do
visit admin_group_path(current_group)
end
2012-10-22 14:42:06 -04:00
When 'I click new group link' do
click_link "New Group"
end
2012-12-25 17:52:20 -05:00
And 'I have group with projects' do
@group = create(:group)
@project = create(:project, group: @group)
@event = create(:closed_issue_event, project: @project)
@project.team << [current_user, :master]
2012-12-25 17:52:20 -05:00
end
2012-10-22 14:42:06 -04:00
And 'submit form with new group info' do
fill_in 'group_name', with: 'gitlab'
fill_in 'group_description', with: 'Group description'
2012-11-27 14:33:56 -05:00
click_button "Create group"
2012-10-22 14:42:06 -04:00
end
Then 'I should see newly created group' do
page.should have_content "Group: gitlab"
page.should have_content "Group description"
2012-10-22 14:42:06 -04:00
end
Then 'I should be redirected to group page' do
current_path.should == admin_group_path(Group.last)
end
2012-12-25 17:52:20 -05:00
When 'I select user "John Doe" from user list as "Reporter"' do
user = User.find_by(name: "John Doe")
select2(user.id, from: "#user_ids", multiple: true)
2012-12-25 17:52:20 -05:00
within "#new_team_member" do
2013-06-20 06:29:17 -04:00
select "Reporter", from: "group_access"
2012-12-25 17:52:20 -05:00
end
2013-06-18 11:39:18 -04:00
click_button "Add users into group"
2012-12-25 17:52:20 -05:00
end
Then 'I should see "John Doe" in team list in every project as "Reporter"' do
2013-06-20 06:29:17 -04:00
within ".group-users-list" do
page.should have_content "John Doe"
2013-06-20 06:29:17 -04:00
page.should have_content "Reporter"
end
2012-12-25 17:52:20 -05:00
end
2013-06-26 08:09:17 -04:00
step 'I should be all groups' do
Group.all.each do |group|
page.should have_content group.name
end
end
2012-12-25 17:52:20 -05:00
protected
def current_group
@group ||= Group.first
end
2012-10-22 14:42:06 -04:00
end