This only applies to RSpec below version 1.3.2. The issue has been fixed in RSpec 1.3.2, and most likely RSpec...
...allowed to be either a space or a nbsp. The step definitions require the htmlentities gem. Capybara This step is part of Spreewald! Then /^I should( not)? see the (?:number...
...0xC2.chr + 0xA0.chr regexp = Regexp.new(no_minus + "\\b" + Regexp.quote(amount) + (unit ? "( |#{nbsp}| )(#{unit}|#{Regexp.quote(HTMLEntities.new.encode(unit, :named))})" :"\\b")) expectation = negate ? :should_not : :should page.body.send(expectation, match(regexp)) end Webrat
When you have a localized website, you may want to redirect users to their preferred language when they visit the...
Ubuntu 12.04 LTS x64, Ruby 1.8.7, Rails 2.13, PDFKit 0.5.4, Phusion Passenger Apache 2 I ran into this, when I...
...clicks on .gallery-image.is-featured Code Save this to features/support/selectors.rb, or update your file: module HtmlSelectorsHelpers def selector_for(locator) case locator # Auto-mapper for BEM classes # # Usage examples: # the main...
...a mapping in #{__FILE__}" end end private def selectorify(string) string.gsub(/ /, '-') end end World(HtmlSelectorsHelpers...
One of the most common production errors are ActionController::MethodNotAllowed errors. They usually happen when someone reloads a form by...
This note describes a Cucumber step definition that lets you say: Then "Mow lawn" should be an option for "Activity...
There are several options, but most of them are impractical. The best way is to use the :ruby filter:
Styling button tags across all major browsers is not easy. Many times you should be fine by using the native...
Capybara will match elements outside of a page's tag. For example, the step definitions below match nodes in a...
...markdown << prose.to_str # make sure the prose gets escaped, even if it is an html_safe string markdown.gsub(/(\*\*)(.*?)(\*\*)/, ' \2 ').html_safe end alias_method :md, :custom_markdown
This cucumber step is useful for testing an image (looking at the src of the image). Then(/^I should see...
Simply give the select helper an option :disabled, passing either a single value or an array. You need to specify...
You can use CSS attribute selectors in your step definitions like this: Then /^the page should have a meta description...
Give your iframe a name attribute (i.e. ) and then simply use When I press "Foo" in the iframe "myframe"
We are consistently having trouble with selenium-webdriver > 2.5.0 where whenever we try to select an option from a Capybara...
You can say this in helpers like link_to and content_tag: = link_to 'Label', root_url, :data => { :foo => 'bar...
If you want to test that a certain text is contained within the document title of your page, you can...
For Capybara, use this step: Then /^"([^"]*)" should be a disabled option for "([^"]*)"(?: within "([^\"]*)")?$/ do |value, field, selector| with_scope(selector...
When you don't know which options are available, but need to have an option selected, use this step.
Using the jQuery adapter breaks the built-in save function of CKEditor. Phenomenon: The page is submitted correctly, but the...
Safari & Chrome Use $x() in your console: $x('//span') # selects all span elements Firefox There's an add-on.
To delay your entire Jasmine test suite until the DOM is ready, add the following: beforeAll(function(done) { $(done); });
Though the W3C even gives it as an example, no browser actually supports this CSS: img:before { content: "something"; }