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 trialArthur Head
12,624 PointsODOT "cleaning up our code"
After running bin/rake, I have 23 examples and 4 failures: I need some help identifying the errors below, which I've been stuck on for a few days now, checking syntax, changing context, etc. : Failures:
1) TodoItemsController GET 'index' returns http success Failure/Error: get 'index' ActionController::UrlGenerationError: No route matches {:action=>"index", :controller=>"todo_items"} # ./spec/controllers/todo_items_controller_spec.rb:7:in `block (3 levels) in <top (required)>'
2) Editing todo items is successful with valid content
Failure/Error: within "#todo_item_#{todo_item.id}" do
NameError:
undefined local variable or method todo_item' for #<RSpec::Core::ExampleGroup::Nested_3:0xba7bac40>
# ./spec/features/todo_items/edit_spec.rb:17:in
block (2 levels) in <top (required)>'
3) Adding todo items displays an error with no content Failure/Error: expect(page).to have_content("Content can't be blank") expected to find text "Content can't be blank" in "There was a problem adding that todo list item. {:error=>\"There was a problem adding that todo list item.\"} 2 errors prohibited this todo item from being saved: Content translation missing: de.activerecord.errors.models.todo_item.attributes.content.blank Content translation missing: de.activerecord.errors.models.todo_item.attributes.content.too_short Content" # ./spec/features/todo_items/create_spec.rb:36:in `block (2 levels) in <top (required)>'
4) Adding todo items displays an error with less than two characters long Failure/Error: expect(page).to have_content("Description translation missing:") expected to find text "Description translation missing:" in "There was a problem adding that todo list item. {:error=>\"There was a problem adding that todo list item.\"} 1 error prohibited this todo item from being saved: Content translation missing: de.activerecord.errors.models.todo_item.attributes.content.too_short Content" # ./spec/features/todo_items/create_spec.rb:48:in `block (2 levels) in <top (required)>'
Arthur Head
12,624 PointsArthur Head
12,624 PointsHere's my code to the associated failed files:
1 todo_items_controller_spec.rb
require 'spec_helper'
describe TodoItemsController do
describe "GET 'index'" do it "returns http success" do get 'index' response.should be_success end end
end
2 edit_spec.rb
require 'spec_helper'
describe "Editing todo items" do let!(:todo_list) { TodoList.create(title:"Grocery list", description: "Groceries") }
it "is successful with valid content" do
end
end
3 create_spec.rb
require 'spec_helper'
describe "Adding todo items" do let!(:todo_list) { TodoList.create(title:"Grocery list", description: "Groceries") }
end
it "displays an error with less than two characters long" do visit_todo_list(todo_list) click_link "New Todo Item" fill_in "Content", with: "2" click_button "Save"
end end
4 create_spec.rb
require 'spec_helper'
describe "Adding todo items" do let!(:todo_list) { TodoList.create(title:"Grocery list", description: "Groceries") }
end
it "displays an error with less than two characters long" do visit_todo_list(todo_list) click_link "New Todo Item" fill_in "Content", with: "2" click_button "Save"
end end