Commit 6f4576b7436ff4573b28ab8305796e96bb2aed29
1 parent
b7a9e41b
Exists in
master
and in
4 other branches
Spinach feature
Showing
3 changed files
with
28 additions
and
1 deletions
Show diff stats
app/views/team_members/import.html.haml
@@ -12,6 +12,6 @@ | @@ -12,6 +12,6 @@ | ||
12 | .input= select_tag(:source_project_id, options_from_collection_for_select(current_user.projects, :id, :name), prompt: "Select project", class: "chosen xxlarge", required: true) | 12 | .input= select_tag(:source_project_id, options_from_collection_for_select(current_user.projects, :id, :name), prompt: "Select project", class: "chosen xxlarge", required: true) |
13 | 13 | ||
14 | .actions | 14 | .actions |
15 | - = submit_tag 'Save', class: "btn save-btn" | 15 | + = submit_tag 'Import', class: "btn save-btn" |
16 | = link_to "Cancel", project_team_index_path(@project), class: "btn cancel-btn" | 16 | = link_to "Cancel", project_team_index_path(@project), class: "btn cancel-btn" |
17 | 17 |
features/project/team_management.feature
@@ -32,3 +32,10 @@ Feature: Project Team management | @@ -32,3 +32,10 @@ Feature: Project Team management | ||
32 | And I click link "Remove from team" | 32 | And I click link "Remove from team" |
33 | Then I visit project "Shop" team page | 33 | Then I visit project "Shop" team page |
34 | And I should not see "Sam" in team list | 34 | And I should not see "Sam" in team list |
35 | + | ||
36 | + Scenario: Import team from another project | ||
37 | + Given I own project "Website" | ||
38 | + And "Mike" is "Website" reporter | ||
39 | + And I click link "Import team from another project" | ||
40 | + When I submit "Website" project for import team | ||
41 | + Then I should see "Mike" in team list as "Reporter" |
features/steps/project/project_team_management.rb
@@ -86,4 +86,24 @@ class ProjectTeamManagement < Spinach::FeatureSteps | @@ -86,4 +86,24 @@ class ProjectTeamManagement < Spinach::FeatureSteps | ||
86 | project = Project.find_by_name("Shop") | 86 | project = Project.find_by_name("Shop") |
87 | project.add_access(user, :write) | 87 | project.add_access(user, :write) |
88 | end | 88 | end |
89 | + | ||
90 | + Given 'I own project "Website"' do | ||
91 | + @project = Factory :project, :name => "Website" | ||
92 | + @project.add_access(@user, :admin) | ||
93 | + end | ||
94 | + | ||
95 | + And '"Mike" is "Website" reporter' do | ||
96 | + user = User.find_by_name("Mike") | ||
97 | + project = Project.find_by_name("Website") | ||
98 | + project.add_access(user, :read) | ||
99 | + end | ||
100 | + | ||
101 | + And 'I click link "Import team from another project"' do | ||
102 | + click_link "Import team from another project" | ||
103 | + end | ||
104 | + | ||
105 | + When 'I submit "Website" project for import team' do | ||
106 | + select 'Website', from: 'source_project_id' | ||
107 | + click_button 'Import' | ||
108 | + end | ||
89 | end | 109 | end |