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
Magnus Braathen
7,726 PointsAdding Validations to Todo Items
at about 5 min into the lesson(todo list application) I encounter the error
Failures:
"1) todo_lists/index renders a list of todo_lists
Failure/Error: assert_select "tr>td", :text => "Title".to_s, :count => 2
MiniTest::Assertion:
Expected exactly 2 elements matching "tr > td", found 1..
<1> expected but was
<2>.
# ./spec/views/todo_lists/index.html.erb_spec.rb:20:in `block (2 levels) in <top (required)>'
when running the bin/rake test, Jason didn't encounter this error
I took a wild guess and commented out both my line 20 and 21 in the file with the error. This "seems" to have solved it(because all 50 tests pass) but I might have broken something by commenting them out? The entire file with the error:
require 'spec_helper'
describe "todo_lists/index" do
before(:each) do
assign(:todo_lists, [
stub_model(TodoList,
:title => "Title",
:description => "MyText"
),
stub_model(TodoList,
:title => "Title",
:description => "MyText"
)
])
end
it "renders a list of todo_lists" do
render
# Run the generator again with the --webrat flag if you want to use webrat matchers
##HERE
# assert_select "tr>td", :text => "Title".to_s, :count => 2
# assert_select "tr>td", :text => "MyText".to_s, :count => 2
##ABOVE
end
end
1 Answer
Jason Seifer
Treehouse Guest TeacherHey Magnus Braathen can you put up a link to your code so we can take a look?