summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-24 15:23:04 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-10-24 15:23:04 +0300
commit6f4576b7436ff4573b28ab8305796e96bb2aed29 (patch)
tree703eab09e57f338cdca8cfcc9124eff0f7978ebf
parentb7a9e41bd269e2b5519928c35592aad96d3707c6 (diff)
downloadgitlab-ce-6f4576b7436ff4573b28ab8305796e96bb2aed29.tar.gz
Spinach feature
-rw-r--r--app/views/team_members/import.html.haml2
-rw-r--r--features/project/team_management.feature7
-rw-r--r--features/steps/project/project_team_management.rb20
3 files changed, 28 insertions, 1 deletions
diff --git a/app/views/team_members/import.html.haml b/app/views/team_members/import.html.haml
index 59a27fd3cc1..34f7fb03288 100644
--- a/app/views/team_members/import.html.haml
+++ b/app/views/team_members/import.html.haml
@@ -12,6 +12,6 @@
.input= select_tag(:source_project_id, options_from_collection_for_select(current_user.projects, :id, :name), prompt: "Select project", class: "chosen xxlarge", required: true)
.actions
- = submit_tag 'Save', class: "btn save-btn"
+ = submit_tag 'Import', class: "btn save-btn"
= link_to "Cancel", project_team_index_path(@project), class: "btn cancel-btn"
diff --git a/features/project/team_management.feature b/features/project/team_management.feature
index ae0c459f333..0ac37620b4e 100644
--- a/features/project/team_management.feature
+++ b/features/project/team_management.feature
@@ -32,3 +32,10 @@ Feature: Project Team management
And I click link "Remove from team"
Then I visit project "Shop" team page
And I should not see "Sam" in team list
+
+ Scenario: Import team from another project
+ Given I own project "Website"
+ And "Mike" is "Website" reporter
+ And I click link "Import team from another project"
+ When I submit "Website" project for import team
+ Then I should see "Mike" in team list as "Reporter"
diff --git a/features/steps/project/project_team_management.rb b/features/steps/project/project_team_management.rb
index 7beca257e36..5c3a9b31129 100644
--- a/features/steps/project/project_team_management.rb
+++ b/features/steps/project/project_team_management.rb
@@ -86,4 +86,24 @@ class ProjectTeamManagement < Spinach::FeatureSteps
project = Project.find_by_name("Shop")
project.add_access(user, :write)
end
+
+ Given 'I own project "Website"' do
+ @project = Factory :project, :name => "Website"
+ @project.add_access(@user, :admin)
+ end
+
+ And '"Mike" is "Website" reporter' do
+ user = User.find_by_name("Mike")
+ project = Project.find_by_name("Website")
+ project.add_access(user, :read)
+ end
+
+ And 'I click link "Import team from another project"' do
+ click_link "Import team from another project"
+ end
+
+ When 'I submit "Website" project for import team' do
+ select 'Website', from: 'source_project_id'
+ click_button 'Import'
+ end
end