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 Write Our First Tests

Alexander Bromage
PLUS
Alexander Bromage
Courses Plus Student 4,014 Points

9 deprecation warnings when running bin/rake spec it says stub_model is deprecated. for example. Please help!

I am getting 9 deprecation warnings when running the first test with rspec. Tried the code snippets provided in other forum questions added into my spec_helper.rb file and looked on stack overflow but nothing I can find tells me why this is occurring and how I can resolve the deprecations.

1 Answer

Vinny Harris-Riviello
Vinny Harris-Riviello
11,898 Points

Same happened to me, so follow instructions on terminal it tells you that stub_model is deprecated. Use the rspec-activemodel-mocks gem instead. So install the gem file or On terminal: gem install rspec-activemodel-mocks --version= 1.0.1 do rbenv rehash then gem install rspec-its --version=1.0.1

Not sure that you need the versions I ended installing versions 1.0.2 and it is fine

then again rbenv rehash

This should take care of 5 of the deprecation, still working on the other 4 :)