Note that there are some explanatory texts on larger screens.

plurals
  1. POCapybara::Element Not Found
    primarykey
    data
    text
    <p>I'm working along with the Rspec book as it develops a 'showtime' rails application, which provides information about films. As far as I can tell, I've copied the code exactly (the book's not that great at letting readers know every step to take), but I'm getting this error.</p> <pre><code>Unable to find select box "Release Year" (Capybara::ElementNotFound) ./features/step_definitions/movie_steps.rb:6:in `/^I create a movie Caddyshack in the Comedy genre$/' </code></pre> <p>My movie_steps.rb file has this code, which provides users a select box to select the release year, which is the element Capybara can't find. </p> <pre><code>#--- When /^I create a movie Caddyshack in the Comedy genre$/ do visit movies_path click_link "Add Movie" fill_in "Title", :with =&gt; "Caddyshack" select "1980", :from =&gt; "Release Year" check "Comedy" click_button "Save" end Then /^Caddyshack should be in the Comedy genre$/ do visit genres_path click_link "Comedy" response.should contain("1 movie") response.should contain("Caddyshack") end </code></pre> <p>In the movies view, I have this code, which is, as far as I can tell, all i need to implement the select box.</p> <pre><code>&lt;%= form_for @movie do |f| %&gt; &lt;%= f.label :title %&gt; &lt;%= f.text_field :title %&gt; &lt;%= f.label :release_year %&gt; &lt;%= f.select :release_year, (1900..2009).to_a.map(&amp;:to_s) %&gt; &lt;% @genres.each do |genre| %&gt; &lt;label&gt; &lt;%=h genre.name %&gt; &lt;%= check_box_tag "genres[]", genre.id %&gt; &lt;/label&gt; &lt;% end %&gt; &lt;%= f.submit "Save" %&gt; &lt;% end %&gt; </code></pre> <p>I'd be grateful for any suggestions you could provide.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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