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

Failing Test

I continue to see the following error message when I attempt to write the test. Looks like it's working for Jason.

1) Creating todo lists redirects to the todo list index page on success Failure/Error: click_link "New Todo list" TypeError: no implicit conversion of nil into String # ./spec/features/todo_lists/create_spec.rb:6:in `block (2 levels) in <top (required)>'

Code in create_spec.rb

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

1 Answer

Michelle Cannito
Michelle Cannito
8,992 Points

After have_content there is text in quotes. Look at your application page. Copy the way you wrote New todo_list on the page and paste it between the quotes. If what is on the page is different than what is between the quotes, your test will fail. A capital letter in one place while the other has lowercase, for instance, is not identical.

Thanks Michelle.

I tested it out a couple times and made sure to copy and paste the text. I also tried to download the project files and get them to run. Saw the same error. I had rails previously installed on my machine, went back through the tutorial of installing with rbenv and now it appears to be working.

Not sure if it was something in how I set up the project or perhaps a user error that I fixed the second time around. Thanks for taking the time to answer my post!