Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Write Our First Tests

1 example, 1 failure

I am running this first Spec and it has a failure I am not sure what I did wrong since I followed every step that the instructor told, pls HELP!

1 example, 1 failure

Failed examples:

rspec ./spec/features/todo_lists/creat_spec.rb:5 # Creating todo lists redirects to the todo list index page on success My code:

require 'spec_helper'

describe "Creating todo lists" do 

  it "redirects to the todo list index page on success" do 
    visit"/todo_lists"
    click_link" New Todo list"
    expect(page).to have_content("New todo_list")



  end

end

3 Answers

Hi Chenzi,

I couldn't see whole errors message, but I think we can look below, we are expecting to have same content (must have same name)

line 7

expect(page).to have_content("New todo_list")

Now let's try go to your localhost:3000/todo_lists/new and see what the title look like in bold. Example - 4:08.

If it is different title, then type exact the same title from localhost:3000/todo_lists/new and replace your content title in create_spec.rb in line 7

expect(page).to have_content("New Todo List")

Hi Chenzi,

I see there is misspelling, let's take a look at file name - "creat_spec.rb"

rspec ./spec/features/todo_lists/creat_spec.rb

Then you can review video again at 4:26

Be careful with spelling missing and spaces.

Hope that helps.

-Salman

thanks so much Salman! I changed the spell and it seems still not working. Finished in 0.39302 seconds 1 example, 1 failure

Failed examples:

rspec ./spec/features/todo_lists/create_spec.rb:5 # Creating todo lists redirects to the todo list index page on success

my code:

require 'spec_helper'

describe "Creating todo lists" do 

  it "redirects to the todo list index page on success" do 
    visit"/todo_lists"
    click_link "New Todo list"
    expect(page).to have_content("New todo_list")



  end

end

EDIT: You can use backticks(ruby) on the top and then another backticks() to show codes colorful that we can read clearly. :)

Example:

` ` `ruby (remove spaces like ```)

      Copy and Paste your codes here

` ` `

Markdown - See "Screencast of posting code"

Jaco Burger
Jaco Burger
20,807 Points

Hi Salman, your suggestion work. I was wondering about this tbh, where did Jason get the "todo_list" part from? Why is his showing "todo_list" and our's "Todo List".

Either way, now I can continue. Thanks man.