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 Cleaning Up Our View

UL and table changes problem to be fixed!

HI Guys, How to overcome this error. Kindly show what and where to change.

Here is the error : Failures:

1) content todo items successful if valid content Failure/Error: within("ul.todo_items") do Capybara::ElementNotFound: Unable to find css "ul.todo_items" # ./spec/features/todo_items/create_spec.rb:22:in `block (2 levels) in <top (required)>'

2) Visit todo items display item content when list have items Failure/Error: expect(page.all("ul.todo_items li").size).to eq(2)

   expected: 2
        got: 0

   (compared using ==)
 # ./spec/features/todo_items/index_spec.rb:31:in `block (2 levels) in <top (required)>'

Failed examples:

rspec ./spec/features/todo_items/create_spec.rb:15 # content todo items successful if valid content rspec ./spec/features/todo_items/index_spec.rb:26 # Visit todo items display item content when list have items


THanks

2 Answers

Laura Fabiola Cabrera
Laura Fabiola Cabrera
11,951 Points

I had the first error. I just changed within("ul.todo_items") do to within("table.todo_items") do

Since we used <table> in the index file.

I'm not sure about the second one.

Seth Kroger
Seth Kroger
56,413 Points

The 2nd can be fixed with: expect(page.all("table.todo_items tr").size)