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 Deleting Todo Lists

Saif Tase
Saif Tase
24,578 Points

Trouble Getting Routing Tests to Pass

I'm at the end of "Deleting Todo Lists" in "Build a Todo List Application with Rails 4". I've just updated the todo_lists_controller_spec, as advised...

let(:valid_attributes) { { "title" => "MyString", "description" => "My Description"} }

...and run

bin/rake spec

This got rid of many of my errors. However, I still have 7 failures:

41 examples, 7 failures, 2 pending

Failed examples:

rspec ./spec/routing/todo_lists_routing_spec.rb:6 # TodoListsController routing routes to #index
rspec ./spec/routing/todo_lists_routing_spec.rb:10 # TodoListsController routing routes to #new
rspec ./spec/routing/todo_lists_routing_spec.rb:18 # TodoListsController routing routes to #edit
rspec ./spec/routing/todo_lists_routing_spec.rb:30 # TodoListsController routing routes to #destroy
rspec ./spec/routing/todo_lists_routing_spec.rb:22 # TodoListsController routing routes to #create
rspec ./spec/routing/todo_lists_routing_spec.rb:26 # TodoListsController routing routes to #update
rspec ./spec/routing/todo_lists_routing_spec.rb:14 # TodoListsController routing routes to #show

I haven't changed the to_do_lists_routing_spec file at all. Navigating through the actual site itself, I don't see any errors with the routing.

require "spec_helper"

describe TodoListsController do
  describe "routing" do

    it "routes to #index" do
      get("/todo_lists").should route_to("todo_lists#index")
    end

    it "routes to #new" do
      get("/todo_lists/new").should route_to("todo_lists#new")
    end

    it "routes to #show" do
      get("/todo_lists/1").should route_to("todo_lists#show", :id => "1")
    end

    it "routes to #edit" do
      get("/todo_lists/1/edit").should route_to("todo_lists#edit", :id => "1")
    end

    it "routes to #create" do
      post("/todo_lists").should route_to("todo_lists#create")
    end

    it "routes to #update" do
      put("/todo_lists/1").should route_to("todo_lists#update", :id => "1")
    end

    it "routes to #destroy" do
      delete("/todo_lists/1").should route_to("todo_lists#destroy", :id => "1")
    end

  end
end

Any idea what's going wrong here?

Nathan Keatch
Nathan Keatch
2,152 Points

I'm getting the exact same errors.