kandanapp / kandan

Kandan is an Open Source Alternative to HipChat
GNU Affero General Public License v3.0
2.72k stars 408 forks source link

Fix deprecations for RSpec 3 #408

Closed bodrovis closed 9 years ago

bodrovis commented 9 years ago

As long as rspec-rails is not locked at any version, 3.1 is used. Therefore deprecation warnings (and errors) are showed in the console when running tests. Specifically, be_true is not longer a valid method - it either should be be_truthy or be true for a strict match, the same applies to be_false. This PR removes most of them (there are a couple more but they are related to CanCan itself).

Also please note that two tests are failing (/spec/features/login_spec.rb, lines 9 and 16) with the message "Could not find an executable ["phantomjs"] on your path." - it was already failing before I made any changes.

scouttyg commented 9 years ago

This looks good, but let's comment on each file what we changed next time -- I had to read up that the reason you removed require 'rspec/autorun' was that it gives the depreciation messages (you mention it in the second sentence of your description, but not where that impacted).

It also looks like you ran bundle update as well, because while some gems will install as dependancies the highest gem level they can download (which is why versioning is important), things like Devise should not have been updated just by doing a fresh install -- Gemfile.lock ensures that top level gems without dependancies in other areas aren't updated unless you ran bundle update.

That means that a ton of other gems were updated at the same time as well, which isn't necessarily a bad thing, but if something fails down the road we won't know if it was because of a gem being updated, because of something in this commit fixed, etc. Better to update the gems not directly related to the task at hand here in another branch so we can always revert just that part of it without reverting the rspec changes as well.

bodrovis commented 9 years ago

@scouttyg Okay, will redo that!

bodrovis commented 9 years ago

@scouttyg Done, I've brought back the original lock and updated only gems related to rspec (like expectations, mocks, core and guard).

bodrovis commented 9 years ago

P.S. The phantomjs error was indeed realted to my environment, fixed that.

scouttyg commented 9 years ago

Great! Thanks for going back and doing this. Looks like pulling in the rails 3.2.21 probably made some conflicts, lets fix those and we can pull this in.

bodrovis commented 9 years ago

That should do the trick

coveralls commented 9 years ago

Coverage Status

Changes Unknown when pulling bc64284653be00648860c62be7151fd99ff20e0e on bodrovis:rspec3 into \ on kandanapp:master**.

scouttyg commented 9 years ago

:+1: