about summary refs log tree commit diff
path: root/spec/controllers/application_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/application_controller_spec.rb')
-rw-r--r--spec/controllers/application_controller_spec.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index 2af12376d..82455d874 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -27,8 +27,8 @@ describe ApplicationController, type: :controller do
       expect(response).to have_http_status(code)
     end
 
-    it "renders template for http" do
-      is_expected.to render_template("errors/#{code}", layout: 'error')
+    it 'renders template for http' do
+      expect(subject).to render_template("errors/#{code}", layout: 'error')
     end
   end
 
@@ -57,26 +57,26 @@ describe ApplicationController, type: :controller do
   describe 'helper_method :single_user_mode?' do
     it 'returns false if it is in single_user_mode but there is no account' do
       allow(Rails.configuration.x).to receive(:single_user_mode).and_return(true)
-      expect(controller.view_context.single_user_mode?).to eq false
+      expect(controller.view_context.single_user_mode?).to be false
     end
 
     it 'returns false if there is an account but it is not in single_user_mode' do
       allow(Rails.configuration.x).to receive(:single_user_mode).and_return(false)
       Fabricate(:account)
-      expect(controller.view_context.single_user_mode?).to eq false
+      expect(controller.view_context.single_user_mode?).to be false
     end
 
     it 'returns true if it is in single_user_mode and there is an account' do
       allow(Rails.configuration.x).to receive(:single_user_mode).and_return(true)
       Fabricate(:account)
-      expect(controller.view_context.single_user_mode?).to eq true
+      expect(controller.view_context.single_user_mode?).to be true
     end
   end
 
   describe 'helper_method :current_flavour' do
     it 'returns "glitch" when theme wasn\'t changed in admin settings' do
-      allow(Setting).to receive(:default_settings).and_return({'skin' => 'default'})
-      allow(Setting).to receive(:default_settings).and_return({'flavour' => 'glitch'})
+      allow(Setting).to receive(:default_settings).and_return({ 'skin' => 'default' })
+      allow(Setting).to receive(:default_settings).and_return({ 'flavour' => 'glitch' })
 
       expect(controller.view_context.current_flavour).to eq 'glitch'
     end
@@ -101,7 +101,8 @@ describe ApplicationController, type: :controller do
 
     it 'returns user\'s flavour when it is set' do
       current_user = Fabricate(:user)
-      current_user.settings['flavour'] = 'glitch'
+      current_user.settings.update(flavour: 'glitch')
+      current_user.save
       sign_in current_user
 
       allow(Setting).to receive(:[]).with('skin').and_return 'default'
@@ -150,7 +151,7 @@ describe ApplicationController, type: :controller do
       end
 
       it 'does not store location for user if it is devise controller' do
-        @request.env["devise.mapping"] = Devise.mappings[:user]
+        @request.env['devise.mapping'] = Devise.mappings[:user]
         get 'create'
         expect(controller.stored_location_for(:user)).to be_nil
       end