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

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")

whoops, here is the error message as well:


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 :)