2011-06-27 15:27:07 +00:00
|
|
|
Then /^I should see the role dropdown on the "([^"]*)"$/ do |user|
|
2011-09-17 14:23:43 +00:00
|
|
|
find(:css, "li.membership[data-role=#{user}] select").should be_present
|
|
|
|
end
|
|
|
|
|
2011-09-17 14:31:50 +00:00
|
|
|
Then /^I should see the role dropdown on the "([^"]*)" without the "([^"]*)" option$/ do |user, option|
|
2011-09-17 14:23:43 +00:00
|
|
|
find(:css, "li.membership[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
|
|
|
|
Then %{I should see the role dropdown on the "#{@member.role}"}
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see the role dropdown on the "([^"]*)"$/ do |user|
|
|
|
|
page.has_css?("li.membership[data-role=#{user}] select").should be_false
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see the role dropdown on myself$/ do
|
|
|
|
Then %{I should not see the role dropdown on the "#{@member.role}"}
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see any role dropdowns$/ do
|
|
|
|
page.has_css?('li.membership select').should be_false
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should see delete on the "([^"]*)"$/ do |role|
|
|
|
|
page.has_css?("li.membership[data-role=#{role}] .actions a.remove").should be_true
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see delete on the "([^"]*)"$/ do |role|
|
|
|
|
page.has_css?("li.membership[data-role=#{role}] .actions a.remove").should be_false
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see delete on myself$/ do
|
|
|
|
Then %{I should not see delete on the "#{@member.role}"}
|
|
|
|
end
|
|
|
|
|
|
|
|
Then /^I should not see any delete buttons$/ do
|
|
|
|
page.has_css?('li.membership .actions a.remove').should be_false
|
|
|
|
end
|
2011-09-17 14:23:43 +00:00
|
|
|
|
|
|
|
When /^I select the "([^"]*)" role for the "author" user/ do |role|
|
|
|
|
Given %{I select "#{role}" from "site[memberships_attributes][2][role]"}
|
|
|
|
end
|