Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Rspec test fail

So I'm receiving the following error when running the rspec test. I'm not quite sure as to where the mistake might be in my Ruby file but here is the error code and my source code below. Any ideas?

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

whoops, here is the error message as well:

Failures:

1) Creating todo lists redirects to the todo list index page on success Failure/Error: expect(page).to have_content("New Todo list") expected to find text "New Todo list" in "New todo_list Description Back" # ./spec/features/todo_lists/create_spec.rb:7:in `block (2 levels) in <top (required)>'

1 Answer

Can you post your html and your routes.rb?

Might be a simple typo; I noticed you used a lowercase 'l' in 'list', rather than a capital "L".

here is the routes rb below

Todo::Application.routes.draw do
  resources :todo_lists
  root 'todo_lists#index'

Which HTML file would you be referring to? There are several. Thank you for your help :)