2012-10-22 20:42:06 +02:00
|
|
|
class AdminGroups < Spinach::FeatureSteps
|
|
|
|
include SharedAuthentication
|
|
|
|
include SharedPaths
|
|
|
|
include SharedActiveTab
|
|
|
|
|
2012-12-25 23:52:20 +01:00
|
|
|
When 'I visit admin group page' do
|
|
|
|
visit admin_group_path(current_group)
|
|
|
|
end
|
|
|
|
|
2012-10-22 20:42:06 +02:00
|
|
|
When 'I click new group link' do
|
|
|
|
click_link "New Group"
|
|
|
|
end
|
|
|
|
|
2012-12-25 23:52:20 +01: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 07:43:25 +01:00
|
|
|
@project.team << [current_user, :master]
|
2012-12-25 23:52:20 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
And 'Create gitlab user "John"' do
|
|
|
|
create(:user, :name => "John")
|
|
|
|
end
|
|
|
|
|
2012-10-22 20:42:06 +02:00
|
|
|
And 'submit form with new group info' do
|
|
|
|
fill_in 'group_name', :with => 'gitlab'
|
2013-02-19 20:01:57 +01:00
|
|
|
fill_in 'group_description', :with => 'Group description'
|
2012-11-27 20:33:56 +01:00
|
|
|
click_button "Create group"
|
2012-10-22 20:42:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should see newly created group' do
|
|
|
|
page.should have_content "Group: gitlab"
|
2013-02-19 20:01:57 +01:00
|
|
|
page.should have_content "Group description"
|
2012-10-22 20:42:06 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
Then 'I should be redirected to group page' do
|
|
|
|
current_path.should == admin_group_path(Group.last)
|
|
|
|
end
|
2012-12-25 23:52:20 +01:00
|
|
|
|
|
|
|
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
|
2012-10-22 20:42:06 +02:00
|
|
|
end
|