Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6907171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:24:07+00:00 2026-05-27T08:24:07+00:00

I’m building an app while following a tutorial in the book Simply Rails 2

  • 0

I’m building an app while following a tutorial in the book Simply Rails 2 and am having trouble getting some tests to pass.

Here are the errors I’m receiving:

  1) Failure:
test_should_show_index(StoriesControllerTest)
[/Users/ryanclark/Projects/shovell/test/functional/stories_controller_test.rb:8:in `test_should_show_index'
 /Users/ryanclark/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.0.2/lib/active_support/testing/default.rb:7:in `run']:
<nil> expected to not be nil.

  2) Failure:
test_should_show_navigation_menu(StoriesControllerTest)
[/Users/ryanclark/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.0.2/lib/action_controller/assertions/selector_assertions.rb:297:in `assert_select'
 /Users/ryanclark/Projects/shovell/test/functional/stories_controller_test.rb:44:in `test_should_show_navigation_menu'
 /Users/ryanclark/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.0.2/lib/active_support/testing/default.rb:7:in `run']:
Expected at least 2 elements matching "#navigation li", found 3.
<false> is not true.

  3) Failure:
test_should_show_new_form(StoriesControllerTest)
[/Users/ryanclark/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.0.2/lib/action_controller/assertions/selector_assertions.rb:297:in `assert_select'
 /Users/ryanclark/Projects/shovell/test/functional/stories_controller_test.rb:18:in `test_should_show_new_form'
 /Users/ryanclark/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.0.2/lib/active_support/testing/default.rb:7:in `run']:
Expected at least 3 elements matching "form p", found 4.
<false> is not true.

My project is on Github and I would really appreciate a little insight if someone would take a look and help me out.

Also, I’m happy to provide more details and code, just trying to keep the post short.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T08:24:08+00:00Added an answer on May 27, 2026 at 8:24 am

    Failure 1: In test ‘test_should_show_index’ at line 8 assert_not_nil assigns(:stories).

    You have no stores with ‘votes_count >= 5’ in your test database. Here is your fixture for Stories (stories.yml):

    one:
      name: My shiny weblog 
      link: http://poocs.net
      user: patrick
    
    two:
      name: SitePoint Forums
      link: http://www.sitepoint.com/forums/
      user: patrick 
    

    All stories have default value for votes_count (it is 0, see db/schema.rb, line 20). You need at least one story to have votes_count >= 5, thus change fixture to something like this:

    one:
      name: My shiny weblog 
      link: http://poocs.net
      user: patrick
    
    two:
      name: SitePoint Forums
      link: http://www.sitepoint.com/forums/
      user: patrick 
      votes_count: 5
    

    Failure 2: In test ‘test_should_show_navigation_menu’ at line 44 assert_select '#navigation li', 2

    Your navigation div has 3 child <li> tags instead of 2 expected (see application.html.erb):

    <ul id="navigation">
        <li><%= link_to 'Front page stories', stories_path %></li>
        <li><%= link_to 'Upcoming stories', bin_stories_path %></li>
        <li><%= link_to 'Submit a new story!', new_story_path %></li>
    </ul>
    

    Failure 3: In test ‘test_should_show_new_form’ at line 18 assert_select 'form p', :count => 3.

    Your form contains 4 <p> tags instead of 3 expected. You can find it inside your template for ‘new’ action method (new.html.erb):

    <% form_for(@story) do |f| %>
      <p>
        <b>Name</b><br />
        <%= f.text_field :name %>
      </p>
    
      <p>
        <b>Link</b><br />
        <%= f.text_field :link %>
      </p>
    
        <p>
            description:<br />
            <%= f.text_area :description %>
        </p>
    
      <p>
        <%= f.submit "Create" %>
      </p>
    <% end %>
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.