2011-06-27 15:27:07 +00:00
|
|
|
Then /^I should see the role dropdown on the "([^"]*)"$/ do |user|
|
2012-03-01 10:07:22 +00:00
|
|
|
find(:css, "#site_memberships_input div.entry[data-role=#{user}] select").should be_present
|
2011-09-17 14:23:43 +00:00
|
|
|
end
|
|
|
|
|
2011-09-17 14:31:50 +00:00
|
|
|
Then /^I should see the role dropdown on the "([^"]*)" without the "([^"]*)" option$/ do |user, option|
|
2012-03-01 10:07:22 +00:00
|
|
|
find(:css, "#site_memberships_input div.entry[data-role=#{user}] select").text.should_not include option
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see the role dropdown on myself$/ do
|
2011-11-27 08:29:09 +00:00
|
|
|
step %{I should see the role dropdown on the "#{@member.role}"}
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see the role dropdown on the "([^"]*)"$/ do |user|
|
2012-03-01 10:07:22 +00:00
|
|
|
page.has_css?("#site_memberships_input div.entry[data-role=#{user}] select").should be_false
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see the role dropdown on myself$/ do
|
2011-11-27 08:29:09 +00:00
|
|
|
step %{I should not see the role dropdown on the "#{@member.role}"}
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see any role dropdowns$/ do
|
2012-03-01 10:07:22 +00:00
|
|
|
page.has_css?('#site_memberships_input div.entry select').should be_false
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see delete on the "([^"]*)"$/ do |role|
|
2012-03-01 10:07:22 +00:00
|
|
|
page.has_css?("#site_memberships_input div.entry[data-role=#{role}] .actions a.remove").should be_true
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see delete on the "([^"]*)"$/ do |role|
|
2012-03-01 10:07:22 +00:00
|
|
|
page.has_css?("#site_memberships_input div.entry[data-role=#{role}] .actions a.remove").should be_false
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see delete on myself$/ do
|
2011-11-27 08:29:09 +00:00
|
|
|
step %{I should not see delete on the "#{@member.role}"}
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see any delete buttons$/ do
|
2012-03-01 10:07:22 +00:00
|
|
|
page.has_css?('#site_memberships_input div.entry .actions a.remove').should be_false
|
2011-06-27 15:27:07 +00:00
|
|
|
end
|
2011-09-17 14:23:43 +00:00
|
|
|
|
|
|
|
When /^I select the "([^"]*)" role for the "author" user/ do |role|
|
2011-11-27 08:29:09 +00:00
|
|
|
step %{I select "#{role}" from "site[memberships_attributes][2][role]"}
|
2011-09-17 14:23:43 +00:00
|
|
|
end
|