Feature: Manage <%= plural_name %> In order to [goal] [stakeholder] wants [behaviour] Scenario: Register new <%= singular_name %> Given I am on the new <%= singular_name %> page <% keyword = 'When' -%> <% named_args.each do |arg| -%> <% if arg.type == 'boolean' -%> <%= keyword %> I uncheck "<%= arg.name.humanize %>" <% else -%> <%= keyword %> I fill in "<%= arg.name.humanize %>" with "<%= arg.value(1) %>" <% end -%> <% keyword = 'And' -%> <% end -%> And I press "Create" <% keyword = 'Then' -%> <% named_args.each do |arg| -%> <%= keyword %> I should see "<%= arg.value(1) %>" <% keyword = 'And' -%> <% end -%> <% if IO.read('features/support/env.rb') =~ /capybara/n -%> # Rails generates Delete links that use Javascript to pop up a confirmation # dialog and then do a HTTP POST request (emulated DELETE request). # # Capybara must use Culerity/Celerity or Selenium2 (webdriver) when pages rely # on Javascript events. Only Culerity/Celerity supports clicking on confirmation # dialogs. # # Since Culerity/Celerity and Selenium2 has some overhead, Cucumber-Rails will # detect the presence of Javascript behind Delete links and issue a DELETE request # instead of a GET request. # # You can turn this emulation off by tagging your scenario with @no-js-emulation. # Turning on browser testing with @selenium, @culerity, @celerity or @javascript # will also turn off the emulation. (See the Capybara documentation for # details about those tags). If any of the browser tags are present, Cucumber-Rails # will also turn off transactions and clean the database with DatabaseCleaner # after the scenario has finished. This is to prevent data from leaking into # the next scenario. # # Another way to avoid Cucumber-Rails' javascript emulation without using any # of the tags above is to modify your views to use