Commit e1882b535c3f4140b8b55d6f3a26525f84c5007b
1 parent
2a63f64f
Exists in
master
and in
4 other branches
More userteam links removed. Removed teams spinach tests
Showing
4 changed files
with
0 additions
and
318 deletions
Show diff stats
app/views/profiles/show.html.haml
| ... | ... | @@ -67,12 +67,6 @@ |
| 67 | 67 | Need a group for several dependent projects? |
| 68 | 68 | = link_to new_group_path, class: "btn btn-tiny" do |
| 69 | 69 | Create a group |
| 70 | - - if current_user.can_create_team? | |
| 71 | - %li | |
| 72 | - %p | |
| 73 | - Want to share a team between projects? | |
| 74 | - = link_to new_team_path, class: "btn btn-tiny" do | |
| 75 | - Create a team | |
| 76 | 70 | - unless current_user.projects_limit_left > 100 |
| 77 | 71 | %fieldset |
| 78 | 72 | %legend | ... | ... |
app/views/projects/new.html.haml
| ... | ... | @@ -40,12 +40,6 @@ |
| 40 | 40 | Need a group for several dependent projects? |
| 41 | 41 | = link_to new_group_path, class: "btn btn-tiny" do |
| 42 | 42 | Create a group |
| 43 | - - if current_user.can_create_team? | |
| 44 | - .clearfix | |
| 45 | - .input.light | |
| 46 | - Want to share a project between team? | |
| 47 | - = link_to new_team_path, class: "btn btn-tiny" do | |
| 48 | - Create a team | |
| 49 | 43 | |
| 50 | 44 | .save-project-loader.hide |
| 51 | 45 | %center | ... | ... |
features/admin/teams.feature
| ... | ... | @@ -1,70 +0,0 @@ |
| 1 | -Feature: Admin Teams | |
| 2 | - Background: | |
| 3 | - Given I sign in as an admin | |
| 4 | - And Create gitlab user "John" | |
| 5 | - | |
| 6 | - Scenario: Create a team | |
| 7 | - When I visit admin teams page | |
| 8 | - And I click new team link | |
| 9 | - And submit form with new team info | |
| 10 | - Then I should be redirected to team page | |
| 11 | - And I should see newly created team | |
| 12 | - | |
| 13 | - Scenario: Add user to team | |
| 14 | - When I visit admin teams page | |
| 15 | - When I have clean "HardCoders" team | |
| 16 | - And I visit "HardCoders" team page | |
| 17 | - When I click to "Add members" link | |
| 18 | - When I select user "John" from user list as "Developer" | |
| 19 | - And submit form with new team member info | |
| 20 | - Then I should see "John" in teams members list as "Developer" | |
| 21 | - | |
| 22 | - Scenario: Assign team to existing project | |
| 23 | - When I visit admin teams page | |
| 24 | - When I have "HardCoders" team with "John" member with "Developer" role | |
| 25 | - When I have "Shop" project | |
| 26 | - And I visit "HardCoders" team page | |
| 27 | - Then I should see empty projects table | |
| 28 | - When I click to "Add projects" link | |
| 29 | - When I select project "Shop" with max access "Reporter" | |
| 30 | - And submit form with new team project info | |
| 31 | - Then I should see "Shop" project in projects list | |
| 32 | - When I visit "Shop" project admin page | |
| 33 | - Then I should see "John" user with role "Reporter" in team table | |
| 34 | - | |
| 35 | - Scenario: Add user to team with ptojects | |
| 36 | - When I visit admin teams page | |
| 37 | - When I have "HardCoders" team with "John" member with "Developer" role | |
| 38 | - And "HardCoders" team assigned to "Shop" project with "Developer" max role access | |
| 39 | - When I have gitlab user "Jimm" | |
| 40 | - And I visit "HardCoders" team page | |
| 41 | - Then I should see members table without "Jimm" member | |
| 42 | - When I click to "Add members" link | |
| 43 | - When I select user "Jimm" ub team members list as "Master" | |
| 44 | - And submit form with new team member info | |
| 45 | - Then I should see "Jimm" in teams members list as "Master" | |
| 46 | - | |
| 47 | - Scenario: Remove member from team | |
| 48 | - Given I have users team "HardCoders" | |
| 49 | - And gitlab user "John" is a member "HardCoders" team | |
| 50 | - And gitlab user "Jimm" is a member "HardCoders" team | |
| 51 | - And "HardCoders" team is assigned to "Shop" project | |
| 52 | - When I visit admin teams page | |
| 53 | - When I visit "HardCoders" team admin page | |
| 54 | - Then I shoould see "John" in members list | |
| 55 | - And I should see "Jimm" in members list | |
| 56 | - And I should see "Shop" in projects list | |
| 57 | - When I click on remove "Jimm" user link | |
| 58 | - Then I should be redirected to "HardCoders" team admin page | |
| 59 | - And I should not to see "Jimm" user in members list | |
| 60 | - | |
| 61 | - Scenario: Remove project from team | |
| 62 | - Given I have users team "HardCoders" | |
| 63 | - And gitlab user "John" is a member "HardCoders" team | |
| 64 | - And gitlab user "Jimm" is a member "HardCoders" team | |
| 65 | - And "HardCoders" team is assigned to "Shop" project | |
| 66 | - When I visit admin teams page | |
| 67 | - When I visit "HardCoders" team admin page | |
| 68 | - Then I should see "Shop" project in projects list | |
| 69 | - When I click on "Relegate" link on "Shop" project | |
| 70 | - Then I should see projects liston team page without "Shop" project |
features/steps/admin/admin_teams.rb
| ... | ... | @@ -1,236 +0,0 @@ |
| 1 | -class AdminTeams < Spinach::FeatureSteps | |
| 2 | - include SharedAuthentication | |
| 3 | - include SharedPaths | |
| 4 | - include SharedActiveTab | |
| 5 | - include SharedAdmin | |
| 6 | - | |
| 7 | - And 'I have own project' do | |
| 8 | - create :project | |
| 9 | - end | |
| 10 | - | |
| 11 | - And 'Create gitlab user "John"' do | |
| 12 | - @user = create(:user, name: "John") | |
| 13 | - end | |
| 14 | - | |
| 15 | - And 'I click new team link' do | |
| 16 | - click_link "New Team" | |
| 17 | - end | |
| 18 | - | |
| 19 | - And 'submit form with new team info' do | |
| 20 | - fill_in 'user_team_name', with: 'gitlab' | |
| 21 | - fill_in 'user_team_description', with: 'description' | |
| 22 | - click_button 'Create team' | |
| 23 | - end | |
| 24 | - | |
| 25 | - Then 'I should be redirected to team page' do | |
| 26 | - current_path.should == admin_team_path(UserTeam.last) | |
| 27 | - end | |
| 28 | - | |
| 29 | - And 'I should see newly created team' do | |
| 30 | - page.should have_content "Team: gitlab" | |
| 31 | - page.should have_content "description" | |
| 32 | - end | |
| 33 | - | |
| 34 | - When 'I visit admin teams page' do | |
| 35 | - visit admin_teams_path | |
| 36 | - end | |
| 37 | - | |
| 38 | - When 'I have clean "HardCoders" team' do | |
| 39 | - @team = create :user_team, name: "HardCoders", owner: current_user | |
| 40 | - end | |
| 41 | - | |
| 42 | - And 'I visit "HardCoders" team page' do | |
| 43 | - visit admin_team_path(UserTeam.find_by_name("HardCoders")) | |
| 44 | - end | |
| 45 | - | |
| 46 | - Then 'I should see only me in members table' do | |
| 47 | - members_list = find("#members_list .member") | |
| 48 | - members_list.should have_content(current_user.name) | |
| 49 | - members_list.should have_content(current_user.username) | |
| 50 | - end | |
| 51 | - | |
| 52 | - When 'I select user "John" from user list as "Developer"' do | |
| 53 | - @user ||= User.find_by_name("John") | |
| 54 | - within "#team_members" do | |
| 55 | - select "#{@user.name} (#{@user.username})", from: "user_ids" | |
| 56 | - select "Developer", from: "default_project_access" | |
| 57 | - end | |
| 58 | - end | |
| 59 | - | |
| 60 | - And 'submit form with new team member info' do | |
| 61 | - click_button 'add_members_to_team' | |
| 62 | - end | |
| 63 | - | |
| 64 | - Then 'I should see "John" in teams members list as "Developer"' do | |
| 65 | - @user ||= User.find_by_name("John") | |
| 66 | - find_in_list("#members_list .member", @user).must_equal true | |
| 67 | - end | |
| 68 | - | |
| 69 | - When 'I visit "John" user admin page' do | |
| 70 | - pending 'step not implemented' | |
| 71 | - end | |
| 72 | - | |
| 73 | - Then 'I should see "HardCoders" team in teams table' do | |
| 74 | - pending 'step not implemented' | |
| 75 | - end | |
| 76 | - | |
| 77 | - When 'I have "HardCoders" team with "John" member with "Developer" role' do | |
| 78 | - @team = create :user_team, name: "HardCoders", owner: current_user | |
| 79 | - @user ||= User.find_by_name("John") | |
| 80 | - @team.add_member(@user, UserTeam.access_roles["Developer"], group_admin: false) | |
| 81 | - end | |
| 82 | - | |
| 83 | - When 'I have "Shop" project' do | |
| 84 | - @project = create :project, name: "Shop" | |
| 85 | - end | |
| 86 | - | |
| 87 | - Then 'I should see empty projects table' do | |
| 88 | - page.should have_content "Projects (0)" | |
| 89 | - end | |
| 90 | - | |
| 91 | - When 'I select project "Shop" with max access "Reporter"' do | |
| 92 | - @project ||= Project.find_by_name("Shop") | |
| 93 | - within "#assign_projects" do | |
| 94 | - select @project.name, from: "project_ids" | |
| 95 | - select "Reporter", from: "greatest_project_access" | |
| 96 | - end | |
| 97 | - | |
| 98 | - end | |
| 99 | - | |
| 100 | - And 'submit form with new team project info' do | |
| 101 | - click_button 'assign_projects_to_team' | |
| 102 | - end | |
| 103 | - | |
| 104 | - Then 'I should see "Shop" project in projects list' do | |
| 105 | - project = Project.find_by_name("Shop") | |
| 106 | - find_in_list("#projects_list .project", project).must_equal true | |
| 107 | - end | |
| 108 | - | |
| 109 | - When 'I visit "Shop" project admin page' do | |
| 110 | - project = Project.find_by_name("Shop") | |
| 111 | - visit admin_project_path(project) | |
| 112 | - end | |
| 113 | - | |
| 114 | - And '"HardCoders" team assigned to "Shop" project with "Developer" max role access' do | |
| 115 | - @team = UserTeam.find_by_name("HardCoders") | |
| 116 | - @project = create :project, name: "Shop" | |
| 117 | - @team.assign_to_project(@project, UserTeam.access_roles["Developer"]) | |
| 118 | - end | |
| 119 | - | |
| 120 | - When 'I have gitlab user "Jimm"' do | |
| 121 | - create :user, name: "Jimm" | |
| 122 | - end | |
| 123 | - | |
| 124 | - Then 'I should see members table without "Jimm" member' do | |
| 125 | - user = User.find_by_name("Jimm") | |
| 126 | - find_in_list("#members_list .member", user).must_equal false | |
| 127 | - end | |
| 128 | - | |
| 129 | - When 'I select user "Jimm" ub team members list as "Master"' do | |
| 130 | - user = User.find_by_name("Jimm") | |
| 131 | - within "#team_members" do | |
| 132 | - select "#{user.name} (#{user.username})", from: "user_ids" | |
| 133 | - select "Developer", from: "default_project_access" | |
| 134 | - end | |
| 135 | - end | |
| 136 | - | |
| 137 | - Then 'I should see "Jimm" in teams members list as "Master"' do | |
| 138 | - user = User.find_by_name("Jimm") | |
| 139 | - find_in_list("#members_list .member", user).must_equal true | |
| 140 | - end | |
| 141 | - | |
| 142 | - Given 'I have users team "HardCoders"' do | |
| 143 | - @team = create :user_team, name: "HardCoders" | |
| 144 | - end | |
| 145 | - | |
| 146 | - And 'gitlab user "John" is a member "HardCoders" team' do | |
| 147 | - @team = UserTeam.find_by_name("HardCoders") | |
| 148 | - @user = User.find_by_name("John") | |
| 149 | - @user = create :user, name: "John" unless @user | |
| 150 | - @team.add_member(@user, UserTeam.access_roles["Master"], group_admin: false) | |
| 151 | - end | |
| 152 | - | |
| 153 | - And 'gitlab user "Jimm" is a member "HardCoders" team' do | |
| 154 | - @team = UserTeam.find_by_name("HardCoders") | |
| 155 | - @user = User.find_by_name("Jimm") | |
| 156 | - @user = create :user, name: "Jimm" unless @user | |
| 157 | - @team.add_member(@user, UserTeam.access_roles["Master"], group_admin: false) | |
| 158 | - end | |
| 159 | - | |
| 160 | - And '"HardCoders" team is assigned to "Shop" project' do | |
| 161 | - @team = UserTeam.find_by_name("HardCoders") | |
| 162 | - @project = create :project, name: "Shop" | |
| 163 | - @team.assign_to_project(@project, UserTeam.access_roles["Developer"]) | |
| 164 | - end | |
| 165 | - | |
| 166 | - When 'I visit "HardCoders" team admin page' do | |
| 167 | - visit admin_team_path(UserTeam.find_by_name("HardCoders")) | |
| 168 | - end | |
| 169 | - | |
| 170 | - Then 'I shoould see "John" in members list' do | |
| 171 | - user = User.find_by_name("John") | |
| 172 | - find_in_list("#members_list .member", user).must_equal true | |
| 173 | - end | |
| 174 | - | |
| 175 | - And 'I should see "Jimm" in members list' do | |
| 176 | - user = User.find_by_name("Jimm") | |
| 177 | - find_in_list("#members_list .member", user).must_equal true | |
| 178 | - end | |
| 179 | - | |
| 180 | - And 'I should see "Shop" in projects list' do | |
| 181 | - project = Project.find_by_name("Shop") | |
| 182 | - find_in_list("#projects_list .project", project).must_equal true | |
| 183 | - end | |
| 184 | - | |
| 185 | - When 'I click on remove "Jimm" user link' do | |
| 186 | - user = User.find_by_name("Jimm") | |
| 187 | - click_link "remove_member_#{user.id}" | |
| 188 | - end | |
| 189 | - | |
| 190 | - Then 'I should be redirected to "HardCoders" team admin page' do | |
| 191 | - current_path.should == admin_team_path(UserTeam.find_by_name("HardCoders")) | |
| 192 | - end | |
| 193 | - | |
| 194 | - And 'I should not to see "Jimm" user in members list' do | |
| 195 | - user = User.find_by_name("Jimm") | |
| 196 | - find_in_list("#members_list .member", user).must_equal false | |
| 197 | - end | |
| 198 | - | |
| 199 | - When 'I click on "Relegate" link on "Shop" project' do | |
| 200 | - project = Project.find_by_name("Shop") | |
| 201 | - click_link "relegate_project_#{project.id}" | |
| 202 | - end | |
| 203 | - | |
| 204 | - Then 'I should see projects liston team page without "Shop" project' do | |
| 205 | - project = Project.find_by_name("Shop") | |
| 206 | - find_in_list("#projects_list .project", project).must_equal false | |
| 207 | - end | |
| 208 | - | |
| 209 | - Then 'I should see "John" user with role "Reporter" in team table' do | |
| 210 | - user = User.find_by_name("John") | |
| 211 | - find_in_list(".team_members", user).must_equal true | |
| 212 | - end | |
| 213 | - | |
| 214 | - When 'I click to "Add members" link' do | |
| 215 | - click_link "Add members" | |
| 216 | - end | |
| 217 | - | |
| 218 | - When 'I click to "Add projects" link' do | |
| 219 | - click_link "Add projects" | |
| 220 | - end | |
| 221 | - | |
| 222 | - protected | |
| 223 | - | |
| 224 | - def current_team | |
| 225 | - @team ||= Team.first | |
| 226 | - end | |
| 227 | - | |
| 228 | - def find_in_list(selector, item) | |
| 229 | - members_list = all(selector) | |
| 230 | - entered = false | |
| 231 | - members_list.each do |member_item| | |
| 232 | - entered = true if member_item.has_content?(item.name) | |
| 233 | - end | |
| 234 | - entered | |
| 235 | - end | |
| 236 | -end |