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