fix tests
This commit is contained in:
parent
eb99feb4a7
commit
690db9693f
10 changed files with 47 additions and 47 deletions
|
@ -83,8 +83,7 @@ class AdminTeams < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
Then 'I should see empty projects table' do
|
||||
projects_list = find("#projects_list")
|
||||
projects_list.has_content?("Relegate").must_equal false
|
||||
page.has_no_css?("#projects_list").must_equal true
|
||||
end
|
||||
|
||||
When 'I select project "Shop" with max access "Reporter"' do
|
||||
|
@ -177,11 +176,13 @@ class AdminTeams < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
And 'I should see "Shop" in projects list' do
|
||||
|
||||
project = Project.find_by_name("Shop")
|
||||
find_in_list("#projects_list .project", project).must_equal true
|
||||
end
|
||||
|
||||
When 'I click on remove "Jimm" user link' do
|
||||
|
||||
user = User.find_by_name("Jimm")
|
||||
click_link "remove_member_#{user.id}"
|
||||
end
|
||||
|
||||
Then 'I should be redirected to "HardCoders" team admin page' do
|
||||
|
@ -189,15 +190,18 @@ class AdminTeams < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
And 'I should not to see "Jimm" user in members list' do
|
||||
|
||||
user = User.find_by_name("Jimm")
|
||||
find_in_list("#members_list .member", user).must_equal false
|
||||
end
|
||||
|
||||
When 'I click on "Relegate" link on "Shop" project' do
|
||||
|
||||
project = Project.find_by_name("Shop")
|
||||
click_link "relegate_project_#{project.id}"
|
||||
end
|
||||
|
||||
Then 'I should see projects liston team page without "Shop" project' do
|
||||
|
||||
project = Project.find_by_name("Shop")
|
||||
find_in_list("#projects_list .project", project).must_equal false
|
||||
end
|
||||
|
||||
Then 'I should see "John" user with role "Reporter" in team table' do
|
||||
|
|
|
@ -175,7 +175,12 @@ class Userteams < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
And 'I select user "John" from list with role "Reporter"' do
|
||||
pending 'step not implemented'
|
||||
user = User.find_by_name("John")
|
||||
within "#team_members" do
|
||||
select user.name, :from => "user_ids"
|
||||
select "Reporter", :from => "default_project_access"
|
||||
end
|
||||
click_button "Add"
|
||||
end
|
||||
|
||||
Then 'I should see user "John" in team list' do
|
||||
|
@ -185,7 +190,7 @@ class Userteams < Spinach::FeatureSteps
|
|||
end
|
||||
|
||||
And 'I have my own project without teams' do
|
||||
project = create :project, creator: current_user
|
||||
@project = create :project, creator: current_user
|
||||
end
|
||||
|
||||
And 'I visit my team page' do
|
||||
|
@ -197,27 +202,26 @@ class Userteams < Spinach::FeatureSteps
|
|||
click_link "Projects"
|
||||
end
|
||||
|
||||
And 'I click link "Assign project to Team"' do
|
||||
click_link "Assign project to Team"
|
||||
end
|
||||
|
||||
Then 'I should see form with my own project in avaliable projects list' do
|
||||
project = current_user.projects.first
|
||||
projects_select = find("#project_ids")
|
||||
projects_select.should have_content(project.name)
|
||||
projects_select.should have_content(@project.name)
|
||||
end
|
||||
|
||||
When 'I submit form with selected project and max access' do
|
||||
project = current_user.projects.first
|
||||
within "#team_projects" do
|
||||
select project.name, :from => "project_ids"
|
||||
within "#assign_projects" do
|
||||
select @project.name, :from => "project_ids"
|
||||
select "Reporter", :from => "greatest_project_access"
|
||||
end
|
||||
click_button "Add"
|
||||
end
|
||||
|
||||
Then 'I should see my own project in team projects list' do
|
||||
project = current_user.projects.first
|
||||
projects = all("table .project")
|
||||
projects.each do |project_row|
|
||||
project_row.should have_content(project.name)
|
||||
end
|
||||
projects = find(".projects-table")
|
||||
projects.should have_content(@project.name)
|
||||
end
|
||||
|
||||
When 'I click link "New Team Member"' do
|
||||
|
@ -227,7 +231,7 @@ class Userteams < Spinach::FeatureSteps
|
|||
protected
|
||||
|
||||
def current_team
|
||||
@user_team ||= Team.first
|
||||
@user_team ||= UserTeam.first
|
||||
end
|
||||
|
||||
def project
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue