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 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.