Sha256: d3bdba5fb2328a6d29b4cda0c2fdc8b19edb6d8b7fe5e7ad84c332eb578bbac2

Contents?: true

Size: 812 Bytes

Versions: 2

Compression:

Stored size: 812 Bytes

Contents

Then /^the form should have inline error messages$/ do
  page.should have_css(".error")
end

When /^the "([^"]*)" field should have autocomplete off$/ do |field|
  field = page.find_field(field)
  field["autocomplete"].should == "off"
end

Then /^"([^"]*)" should have the error "([^"]*)"$/ do |field, error|
  field = page.find_field(field)
  field.find(:xpath, "following-sibling::p[@class='inline-errors'][contains(text(), '#{error}')]").should_not be_nil
end

Then /^the "([^"]*)" field(?: within "([^"]*)")? should be empty$/ do |field, selector|
  with_scope(selector) do
    field = find_field(field)
    field_value = (field.tag_name == 'textarea') ? field.text : field.value
    if field_value.respond_to? :should
      field_value.should be_nil
    else
      assert_nil(field_value)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
saucy-0.2.1 lib/generators/saucy/features/templates/step_definitions/html_steps.rb
saucy-0.2.0 lib/generators/saucy/features/templates/step_definitions/html_steps.rb