gitlabhq/features/step_definitions/project/project_team_steps.rb

56 lines
1.6 KiB
Ruby
Raw Normal View History

2012-06-18 18:34:09 +02:00
Given /^gitlab user "(.*?)"$/ do |arg1|
Factory :user, :name => arg1
end
Given /^"(.*?)" is "(.*?)" developer$/ do |arg1, arg2|
user = User.find_by_name(arg1)
project = Project.find_by_name(arg2)
project.add_access(user, :write)
end
Then /^I should be able to see myself in team$/ do
page.should have_content(@user.name)
page.should have_content(@user.email)
end
Then /^I should see "(.*?)" in team list$/ do |arg1|
user = User.find_by_name(arg1)
page.should have_content(user.name)
page.should have_content(user.email)
end
Given /^I select "(.*?)" as "(.*?)"$/ do |arg1, arg2|
user = User.find_by_name(arg1)
2012-09-06 08:15:51 +02:00
within "#new_team_member" do
select user.name, :from => "user_ids"
select arg2, :from => "project_access"
2012-06-18 18:34:09 +02:00
end
click_button "Save"
end
Then /^I should see "(.*?)" in team list as "(.*?)"$/ do |arg1, arg2|
user = User.find_by_name(arg1)
role_id = find(".user_#{user.id} #team_member_project_access").value
role_id.should == UsersProject.access_roles[arg2].to_s
end
Given /^I change "(.*?)" role to "(.*?)"$/ do |arg1, arg2|
user = User.find_by_name(arg1)
2012-09-06 08:15:51 +02:00
within ".user_#{user.id}" do
2012-06-18 18:34:09 +02:00
select arg2, :from => "team_member_project_access"
end
end
Then /^I should see "(.*?)" team profile$/ do |arg1|
user = User.find_by_name(arg1)
page.should have_content(user.name)
page.should have_content(user.email)
page.should have_content("To team list")
end
Then /^I should not see "(.*?)" in team list$/ do |arg1|
user = User.find_by_name(arg1)
page.should_not have_content(user.name)
page.should_not have_content(user.email)
end