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

Failed TodoItem#completed? is false when completed_is blank - RSpec 3.0 SOLVED

This isn't a question; rather a solution to all others that will run into this in the future.

Since Jason is running rspec 2.99, there are some slight variations.

Under 'Cleaning Up Our Views' for odot, we set the false and true methods, as FALSE & TRUE.

In rspec 2.99, this is what our code looked like:

    expect(todo_item.completed?).to be_false
    expect(todo_item.completed?).to be_true

In rspec 3.0 and above, this is what our code SHOULD look like:

    expect(todo_item.completed?).to be_falsey
    expect(todo_item.completed?).to be_truthy

Hope this helps everyone that is facing this problem!

1 Answer

Brandon Barrette
Brandon Barrette
20,485 Points

Thanks for posting that! This always becomes a problem with major version changes.