Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Solved by joaomilho:</p> <p>You should do one, and only one, of the following:</p> <p>Rename your submit button to 'Create' Change your test to 'And I press "Save"' Add to your button an id, and also change the test, like this:</p> <p>view = f.submit 'Save', :id => :foo</p> <p>test And I press "foo"</p> <p>1 scenario (1 passed) 3 steps (3 passed) 0m2.510s</p> <p>Same behavior here, I'm using:</p> <p>Rails 3 Cucumber/Capybara/Haml</p> <pre><code>Feature: Manage posts In order to [goal] [stakeholder] wants [behaviour] @wip Scenario: Register new post # features/manage_posts.feature:6 Given I am on the new post page # features/step_definitions/web_steps.rb:19 When I fill in "Title" with "title 1" # features/step_definitions/web_steps.rb:40 And I fill in "Body" with "body 1" # features/step_definitions/web_steps.rb:40 And I uncheck "Published" # features/step_definitions/web_steps.rb:83 And I press "Create" # features/step_definitions/web_steps.rb:27 Then I should see "title 1" # features/step_definitions/web_steps.rb:108 And I should see "body 1" # features/step_definitions/web_steps.rb:108 And I should see "false" # features/step_definitions/web_steps.rb:108 </code></pre> <p>Step:</p> <pre><code>When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| with_scope(selector) do click_button(button) selenium.wait_for_page_to_load end end </code></pre> <p>View New:</p> <pre><code>%h1 New post = render 'form' = link_to 'Back', posts_path </code></pre> <p>Error:</p> <pre><code> no button with value or id or text 'Create' found (Capybara::ElementNotFound) ./features/step_definitions/web_steps.rb:29 ./features/step_definitions/web_steps.rb:14:in `with_scope' ./features/step_definitions/web_steps.rb:28:in `/^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/' features/manage_posts.feature:11:in `And I press "Create"' </code></pre> <p>_form:</p> <pre><code>= form_for @post do |f| -if @post.errors.any? #errorExplanation %h2= "#{pluralize(@post.errors.count, "error")} prohibited this post from being saved:" %ul - @post.errors.full_messages.each do |msg| %li= msg .field = f.label :title = f.text_field :title .field = f.label :body = f.text_area :body .field = f.label :published = f.check_box :published .actions = f.submit 'Save' </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload