Commit aada9bb4

mo khan <mo@mokhan.ca>
2014-06-10 04:38:09
upgrade to rspec 2.99 and make compatible with rspec 3.0
1 parent 46e08d7
spec/controllers/my/avatars_controller_spec.rb
@@ -6,7 +6,7 @@ describe My::AvatarsController do
   context "when logged in " do
     before { http_login(user) }
 
-    describe :update do
+    describe "#update" do
       context "when uploading a new avatar" do
         let(:image) { Rack::Test::UploadedFile.new('spec/fixtures/images/gorilla.jpg', 'image/jpeg') }
 
@@ -27,7 +27,7 @@ describe My::AvatarsController do
       end
     end
 
-    describe :edit do
+    describe "#edit" do
       before :each do
         get :edit, :id => user.id
       end
spec/controllers/my/cakes_controller_spec.rb
@@ -5,7 +5,7 @@ describe My::CakesController do
     let(:user){ create(:user) }
     before { http_login(user) }
 
-    describe :index do
+    describe "#index" do
       let!(:my_creation) { create(:creation) }
       let!(:other_creation) { create(:creation) }
 
spec/controllers/my/favorites_controller_spec.rb
@@ -1,7 +1,7 @@
 require "spec_helper"
 
 describe My::FavoritesController do
-  describe :index do
+  describe "#index" do
     let(:user) { create(:user) }
     let(:favorite_cake) { create(:creation) }
 
spec/controllers/my/passwords_controller_spec.rb
@@ -1,7 +1,7 @@
 require "spec_helper"
 
 describe My::PasswordsController do
-  describe :update do
+  describe "#update" do
     context "when not logged in" do
       let(:user) { create(:user) }
 
@@ -36,14 +36,14 @@ describe My::PasswordsController do
         end
 
         it "should update the users password" do
-          user.reload.valid_password?(new_password).should be_true
+          user.reload.valid_password?(new_password).should be_truthy
         end
       end
     end
 
   end
 
-  describe :index do
+  describe "#index" do
     context 'when logged in' do
       let(:user) { create(:user) }
 
spec/controllers/my/photos_controller_spec.rb
@@ -10,7 +10,7 @@ module My
       http_login(user)
     end
 
-    describe :create do
+    describe "#create" do
       let(:image) { Rack::Test::UploadedFile.new("spec/fixtures/images/gorilla.jpg", "image/jpeg") }
 
       before :each do
@@ -31,7 +31,7 @@ module My
       end
     end
 
-    describe :delete do
+    describe "#delete" do
       let!(:photo) { create(:photo, creation_id: cake.id, image_processing: nil) }
       let(:asset_host) { ENV['ASSET_HOST'] }
 
@@ -44,7 +44,7 @@ module My
       end
 
       it "should destroy the photo" do
-        Photo.exists?(photo.id).should be_false
+        Photo.exists?(photo.id).should be_falsey
       end
 
       it "should respond with the proper json" do
spec/controllers/my/settings_controller_spec.rb
@@ -1,7 +1,7 @@
 require "spec_helper"
 
 describe My::SettingsController do
-  describe :index do
+  describe "#index" do
     it "should load the current user" do
       user = create(:user)
       http_login(user)
@@ -10,7 +10,7 @@ describe My::SettingsController do
     end
   end
 
-  describe :update do
+  describe "#update" do
     let(:user) { create(:user) }
 
     before :each do
spec/controllers/creation_tags_controller_spec.rb
@@ -1,7 +1,7 @@
 require "spec_helper"
 
 describe CreationTagsController do
-  describe :index do
+  describe "#index" do
     let(:cake) { create(:creation) }
     let(:user) { create(:user) }
 
@@ -15,7 +15,7 @@ describe CreationTagsController do
       assigns(:tags).first.name.should == "cake"
     end
   end
-  describe :show do
+  describe "#show" do
     let(:user) { create(:user) }
     let(:tag) { "cake" }
     let(:tagged_tutorial) { create(:tutorial) }
spec/controllers/creations_controller_spec.rb
@@ -9,7 +9,7 @@ describe CreationsController do
     creation.photos.create(image: photo, image_processing: nil)
   end
 
-  describe :index do
+  describe "#index" do
     let(:restricted_creation){ create(:creation, :user => user, :is_restricted => true) }
 
     before { get :index }
@@ -26,14 +26,14 @@ describe CreationsController do
   context "when logged in" do
     before { http_login(user) }
 
-    describe :show do
+    describe "#show" do
       it "assigns the requested creation" do
         get :show, :id => creation.id
         assigns(:creation).should == creation
       end
     end
 
-    describe :new do
+    describe "#new" do
       it "assigns a new creation" do
         new_creation = double
         Creation.stub(:new).and_return(new_creation)
@@ -42,14 +42,14 @@ describe CreationsController do
       end
     end
 
-    describe :edit do
+    describe "#edit" do
       it "assigns the requested creation as @creation" do
         get :edit, :id => creation.id
         assigns(:creation).should eq(creation)
       end
     end
 
-    describe :post do
+    describe "#post" do
       describe "with valid params" do
         let(:category) { create(:category) }
 
@@ -67,7 +67,7 @@ describe CreationsController do
           assigns(:creation).should_not be_nil
           assigns(:creation).name.should == 'stone'
           assigns(:creation).story.should == 'morning glory'
-          assigns(:creation).is_restricted.should be_true
+          assigns(:creation).is_restricted.should be_truthy
           assigns(:creation).watermark.should == 'watery'
         end
 
@@ -89,7 +89,7 @@ describe CreationsController do
       end
     end
 
-    describe :patch do
+    describe "#patch" do
       describe "with valid params" do
         before { patch :update, :id => creation.id, :creation => {:name => 'params'} }
 
@@ -119,7 +119,7 @@ describe CreationsController do
       end
     end
 
-    describe :destroy do
+    describe "#destroy" do
       before :each do
         delete :destroy, :id => creation.id
       end
spec/controllers/tutorials_controller_spec.rb
@@ -11,7 +11,7 @@ describe TutorialsController do
     request.env['warden'] = double(Warden, :authenticate => user, :authenticate! => user)
   end
 
-  describe :index do
+  describe "#index" do
     let(:tutorial) { create(:tutorial) }
 
     before :each do
@@ -24,7 +24,7 @@ describe TutorialsController do
     end
   end
 
-  describe :show do
+  describe "#show" do
     let(:tutorial) { create(:tutorial) }
 
     before :each do
@@ -37,14 +37,14 @@ describe TutorialsController do
     end
   end
 
-  describe :new do
+  describe "#new" do
     it "assigns a new tutorial as @tutorial" do
       get :new
       assigns(:tutorial).should be_a_new(Tutorial)
     end
   end
 
-  describe :edit do
+  describe "#edit" do
     let(:tutorial) { create(:tutorial) }
 
     it "assigns the requested tutorial as @tutorial" do
@@ -54,7 +54,7 @@ describe TutorialsController do
     end
   end
 
-  describe :create do
+  describe "#create" do
     describe "with valid params" do
       before :each do
         post :create, {:tutorial => {:url => 'http://blah.com', :heading => "hello world"} }
@@ -96,7 +96,7 @@ describe TutorialsController do
     end
   end
 
-  describe :patch do
+  describe "#patch" do
     describe "with valid params" do
       let(:tutorial) { create(:tutorial) }
 
@@ -134,7 +134,7 @@ describe TutorialsController do
     end
   end
 
-  describe :destroy do
+  describe "#destroy" do
     let(:tutorial) { create(:tutorial) }
 
     before :each do
spec/helpers/application_helper_spec.rb
@@ -1,7 +1,7 @@
 require "spec_helper"
 
 describe ApplicationHelper do
-  describe :disqus_auth do
+  describe "#disqus_auth" do
     let(:user) { OpenStruct.new(id: 1, name: 'mo', email: 'test@cakeside.com', :to_param => '1-mo') }
 
     before :each do
spec/models/user_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 describe User do
-  describe :properties do
+  describe "#properties" do
     it { should respond_to :name }
     it { should respond_to :email }
     it { should respond_to :twitter }
@@ -61,7 +61,7 @@ describe User do
       let(:result) { sut.already_likes(cake) }
 
       it "should return true" do
-        result.should be_true
+        result.should be_truthy
       end
     end
 
@@ -69,7 +69,7 @@ describe User do
       let(:result) { sut.already_likes(cake) }
 
       it "should return false" do
-        result.should be_false
+        result.should be_falsey
       end
     end
   end
spec/services/application/handlers/process_photo_spec.rb
@@ -7,7 +7,7 @@ describe ProcessPhoto do
 
   describe "#handles?" do
     it "handles photo uploads" do
-      subject.handles?(:upload_photo).should be_true
+      subject.handles?(:upload_photo).should be_truthy
     end
   end
 
spec/services/handlers/publish_cake_to_twitter_spec.rb
@@ -8,7 +8,7 @@ describe PublishCakeToTwitter do
 
   describe "#handles?" do
     it "handles cake_published" do
-      subject.handles?(:cake_published).should be_true
+      subject.handles?(:cake_published).should be_truthy
     end
   end
 
spec/services/infrastructure/blob_storage_spec.rb
@@ -12,7 +12,7 @@ describe BlobStorage do
       subject.upload(key, file)
 
       object = AWS::S3.new.buckets[bucket].objects[key]
-      expect(object.exists?).to be_true
+      expect(object.exists?).to be_truthy
     end
   end
 end
spec/support/devise.rb → spec/support/devise_helper.rb
File renamed without changes
spec/spec_helper.rb
@@ -44,4 +44,6 @@ RSpec.configure do |config|
   config.after(:each) do
     DatabaseCleaner.clean
   end
+  config.infer_spec_type_from_file_location!
+  config.raise_errors_for_deprecations!
 end
Gemfile
@@ -48,7 +48,7 @@ end
 
 group :development, :test do
   gem 'sqlite3'
-  gem 'rspec-rails'
+  gem 'rspec-rails', '2.99.0'
   gem 'teaspoon'
   gem 'database_cleaner'
   gem 'factory_girl_rails'
Gemfile.lock
@@ -225,18 +225,21 @@ GEM
     rdoc (4.1.1)
       json (~> 1.4)
     rmagick (2.13.2)
-    rspec-core (2.14.8)
-    rspec-expectations (2.14.5)
+    rspec-collection_matchers (1.0.0)
+      rspec-expectations (>= 2.99.0.beta1)
+    rspec-core (2.99.0)
+    rspec-expectations (2.99.0)
       diff-lcs (>= 1.1.3, < 2.0)
-    rspec-mocks (2.14.6)
-    rspec-rails (2.14.2)
+    rspec-mocks (2.99.0)
+    rspec-rails (2.99.0)
       actionpack (>= 3.0)
       activemodel (>= 3.0)
       activesupport (>= 3.0)
       railties (>= 3.0)
-      rspec-core (~> 2.14.0)
-      rspec-expectations (~> 2.14.0)
-      rspec-mocks (~> 2.14.0)
+      rspec-collection_matchers
+      rspec-core (~> 2.99.0)
+      rspec-expectations (~> 2.99.0)
+      rspec-mocks (~> 2.99.0)
     rubyzip (1.1.3)
     sass (3.2.19)
     sass-rails (4.0.3)
@@ -354,7 +357,7 @@ DEPENDENCIES
   poltergeist
   rails (~> 4.0.5)
   rmagick (~> 2.13.0)
-  rspec-rails
+  rspec-rails (= 2.99.0)
   sass-rails (~> 4.0)
   sdoc
   selenium-webdriver