From 0beed70d7f649c4685ff423b8391572e5fba9f2c Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Wed, 18 Jun 2014 18:05:28 +0300 Subject: [PATCH] some houndci fixes --- app/models/user.rb | 3 +-- config/routes.rb | 4 ++-- db/migrate/20140603092041_create_openids.rb | 2 +- spec/support/omniauth_macros.rb | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 3bd4fad8..48cc14d3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -25,7 +25,6 @@ class User < ActiveRecord::Base # ====Returns # * +User::ActiveRecord_Relation+ -> user def self.find_for_auth(auth, current_user = nil) - user = current_user if user.nil? # No current user available, user is not already logged in @@ -34,7 +33,7 @@ class User < ActiveRecord::Base if user.new_record? user.email = auth.info.email - user.password = Devise.friendly_token[0,20] + user.password = Devise.friendly_token[0, 20] user.skip_confirmation! end diff --git a/config/routes.rb b/config/routes.rb index 30c401ca..36581786 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,9 +2,9 @@ Osem::Application.routes.draw do get 'conference/show' - devise_for :users, :controllers => { registrations: :registrations, + devise_for :users, controllers: { registrations: :registrations, omniauth_callbacks: 'users/omniauth_callbacks' }, - :path => 'accounts' + path: 'accounts' namespace :admin do resources :users diff --git a/db/migrate/20140603092041_create_openids.rb b/db/migrate/20140603092041_create_openids.rb index 8c55e8fd..4ca63029 100644 --- a/db/migrate/20140603092041_create_openids.rb +++ b/db/migrate/20140603092041_create_openids.rb @@ -1,4 +1,4 @@ -class CreateOpenids< ActiveRecord::Migration +class CreateOpenids < ActiveRecord::Migration def change create_table :openids do |t| t.string :provider diff --git a/spec/support/omniauth_macros.rb b/spec/support/omniauth_macros.rb index 767e048f..67280934 100644 --- a/spec/support/omniauth_macros.rb +++ b/spec/support/omniauth_macros.rb @@ -16,7 +16,7 @@ module OmniauthMacros }) end - def mock_auth_new_user_fb + def mock_auth_new_user_fb OmniAuth.config.mock_auth[:facebook] = OmniAuth::AuthHash.new({ provider: 'google', uid: 'facebook-test-uid-1', @@ -61,4 +61,4 @@ module OmniauthMacros } }) end -end \ No newline at end of file +end