Sha256: c756a6917d790d83f7f6eeade7c7980b1c30af3e24643b0fb476f2882a46ca76

Contents?: true

Size: 679 Bytes

Versions: 3

Compression:

Stored size: 679 Bytes

Contents

module HelperMethods
  
  # Checks for missing translations after each test
  def teardown
    unless source.blank?
      matches = source.match(/translation[\s-]+missing[^"]*/) || []
      assert_equal 0, matches.length, "Translation Missing! - #{matches[0]}"
    end
  end
  
  # An assertion for ensuring content has made it to the page.
  #    
  #    assert_seen "Site Title"
  #    assert_seen "Peanut Butter Jelly Time", :within => ".post-title h1"
  #      
  def assert_seen(text, opts={})
    if opts[:within]
      within(opts[:within]) do
        assert has_content?(text)
      end
    else
      assert has_content?(text)
    end
  end
  
end

World(HelperMethods)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_variant_options-0.1.1 features/support/helper_methods.rb
spree_variant_options-0.1.0 features/support/helper_methods.rb
spree_variant_options-0.1.0.rc1 features/support/helper_methods.rb