must now set the devise default scope (since we now have an :email scope)

and rubocop fixes
This commit is contained in:
Brett Walker 2017-09-24 19:52:49 +02:00
parent d7d335c05b
commit d97b577a1b
6 changed files with 8 additions and 8 deletions

View File

@ -175,7 +175,7 @@ Devise.setup do |config|
# Configure the default scope given to Warden. By default it's the first
# devise role declared in your routes (usually :user).
# config.default_scope = :user
config.default_scope = :user # now have an :email scope as well, so set the default
# Configure sign_out behavior.
# Sign_out action can be scoped (i.e. /users/sign_out affects only :user scope).

View File

@ -17,7 +17,7 @@ describe ProfilesController do
it "allows an email update without confirmation if existing verified email" do
user = create(:user)
email = create(:email, :confirmed, user: user, email: 'john@gmail.com')
create(:email, :confirmed, user: user, email: 'john@gmail.com')
sign_in(user)
put :update,

View File

@ -362,7 +362,7 @@ describe User do
describe '#check_for_verified_email' do
let(:user) { create(:user) }
let(:secondary) { create(:email, :confirmed, email: 'secondary@example.com', user: user, ) }
let(:secondary) { create(:email, :confirmed, email: 'secondary@example.com', user: user) }
it 'allows a verfied secondary email to be used as the primary without needing reconfirmation' do
user.update_attributes!(email: secondary.email)