Add functional in admin section
This commit is contained in:
parent
17ea019f4e
commit
9c574464a6
7 changed files with 106 additions and 19 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue