Commit 6f4576b7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Spinach feature

parent b7a9e41b
......@@ -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"
......@@ -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"
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment