Hi,
I bought the book and been following and liking it so far! But then I hit a wall...
Trying to run all the 5 tests (13 assertions) results in the assert_select failing with
This is what my new.html.erb looks like:Code:1) Failure: test_should_show_new_form(StoriesControllerTest) [/test/functional/stories_controller_test.rb:17]: Expected at least 3 elements matching "form p", found 0. <false> is not true.
And this is the part of the test that fails:HTML Code:<%= error_messages_for 'story' %> <% form_for @story do |f| %> <p> name:<br /> <%= f.text_field :name %> </p> <p> link:<br /> <%= f.text_field :link %> </p> <p> <%= submit_tag %> </p> <% end %>
Code Ruby:assert_select "form p", :count => 3
Finally, this is what the page source looks like:
I tried googling a bit and only advice I found was to re-create the test and/or new.html.erb file(s) and make sure they're saved as UTF-8. One was, other wasnt, so I saved them both as UTF-8 but unfortunately this did not help. Any ideas how to get the test to pass?HTML Code:<form action="/stories" class="new_story" id="new_story" method="post"><div style="margin:0;padding:0"><input name="authenticity_token" type="hidden" value="DDY3863fJMhFT3QypnQMOVegpzgpsmC4n5Qd8REe4Mo=" /></div> <p> name:<br /> <input id="story_name" name="story[name]" size="30" type="text" /> </p> <p> link:<br /> <input id="story_link" name="story[link]" size="30" type="text" /> </p> <p> <input name="commit" type="submit" value="Save changes" /> </p> </form>







Bookmarks