Updating cucumber features
This commit is contained in:
parent
c27b38d69a
commit
de3e0bd91a
5 changed files with 11 additions and 11 deletions
|
|
@ -150,12 +150,12 @@ end
|
||||||
|
|
||||||
Then /^(?:|I )should not see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector, scope_selector|
|
Then /^(?:|I )should not see a "([^\"]*)"(?: within "([^\"]*)")?$/ do |selector, scope_selector|
|
||||||
with_scope(scope_selector) do
|
with_scope(scope_selector) do
|
||||||
current_scope.has_css?(selector, :visible => true).should be_false
|
current_scope.has_css?(selector, :visible => true).should be false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^page should (not )?have "([^\"]*)"$/ do |negate, selector|
|
Then /^page should (not )?have "([^\"]*)"$/ do |negate, selector|
|
||||||
page.has_css?(selector).should ( negate ? be_false : be_true )
|
page.has_css?(selector).should ( negate ? (be false) : (be true) )
|
||||||
end
|
end
|
||||||
|
|
||||||
When /^I have turned off jQuery effects$/ do
|
When /^I have turned off jQuery effects$/ do
|
||||||
|
|
@ -178,7 +178,7 @@ Then /^the "([^"]*)" field(?: within "([^"]*)")? should be filled with "([^"]*)"
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see (\d+) contacts$/ do |n_posts|
|
Then /^I should see (\d+) contacts$/ do |n_posts|
|
||||||
has_css?("#people_stream .stream_element", :count => n_posts.to_i).should be_true
|
has_css?("#people_stream .stream_element", :count => n_posts.to_i).should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
And /^I scroll down$/ do
|
And /^I scroll down$/ do
|
||||||
|
|
@ -217,15 +217,15 @@ And /^I click close on all the popovers$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see a flash message indicating success$/ do
|
Then /^I should see a flash message indicating success$/ do
|
||||||
flash_message_success?.should be_true
|
flash_message_success?.should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see a flash message indicating failure$/ do
|
Then /^I should see a flash message indicating failure$/ do
|
||||||
flash_message_failure?.should be_true
|
flash_message_failure?.should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see a flash message with a warning$/ do
|
Then /^I should see a flash message with a warning$/ do
|
||||||
flash_message_alert?.should be_true
|
flash_message_alert?.should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should see a flash message containing "(.+)"$/ do |text|
|
Then /^I should see a flash message containing "(.+)"$/ do |text|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Then /^I should not see any posts in my stream$/ do
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^I should not be able to submit the publisher$/ do
|
Then /^I should not be able to submit the publisher$/ do
|
||||||
expect(publisher_submittable?).to be_false
|
expect(publisher_submittable?).to be false
|
||||||
end
|
end
|
||||||
|
|
||||||
Given /^"([^"]*)" has a public post with text "([^"]*)"$/ do |email, text|
|
Given /^"([^"]*)" has a public post with text "([^"]*)"$/ do |email, text|
|
||||||
|
|
|
||||||
|
|
@ -157,14 +157,14 @@ end
|
||||||
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector|
|
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector|
|
||||||
with_scope(selector) do
|
with_scope(selector) do
|
||||||
field_checked = find_field(label)['checked']
|
field_checked = find_field(label)['checked']
|
||||||
field_checked.should be_true
|
field_checked.should eq('true')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector|
|
Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector|
|
||||||
with_scope(selector) do
|
with_scope(selector) do
|
||||||
field_checked = find_field(label)['checked']
|
field_checked = find_field(label)['checked']
|
||||||
field_checked.should be_false
|
field_checked.should be false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ module ApplicationCukeHelpers
|
||||||
|
|
||||||
def confirm_form_validation_error(element)
|
def confirm_form_validation_error(element)
|
||||||
is_invalid = page.evaluate_script("$('#{element}').is(':invalid')")
|
is_invalid = page.evaluate_script("$('#{element}').is(':invalid')")
|
||||||
is_invalid.should be_true
|
is_invalid.should be true
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_fields_validation_error(field_list)
|
def check_fields_validation_error(field_list)
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ module PublishingCukeHelpers
|
||||||
def expand_first_post
|
def expand_first_post
|
||||||
within(".stream_element", match: :first) do
|
within(".stream_element", match: :first) do
|
||||||
find(".expander").click
|
find(".expander").click
|
||||||
has_css?(".expander").should be_false
|
has_css?(".expander").should be false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue