diff options
author | Brett Walker <brett@digitalmoksha.com> | 2017-09-14 16:18:32 +0200 |
---|---|---|
committer | Brett Walker <brett@digitalmoksha.com> | 2017-09-23 15:26:04 +0200 |
commit | a32f1dddf2ed65f3e61ded56256da2996d6442bd (patch) | |
tree | ff1b82df8738ed7c3ffa21086537bd7c44199ef8 /spec | |
parent | a000c2a1443beb7de0b5193f89916ccce57170c5 (diff) | |
download | gitlab-ce-a32f1dddf2ed65f3e61ded56256da2996d6442bd.tar.gz |
fixes for rubocop
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/profiles/emails_controller_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/gpg_key_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/user_spec.rb | 10 |
3 files changed, 10 insertions, 12 deletions
diff --git a/spec/controllers/profiles/emails_controller_spec.rb b/spec/controllers/profiles/emails_controller_spec.rb index bdf040ba295..69b34db0c2e 100644 --- a/spec/controllers/profiles/emails_controller_spec.rb +++ b/spec/controllers/profiles/emails_controller_spec.rb @@ -8,7 +8,7 @@ describe Profiles::EmailsController do end describe '#create' do - let(:email_params) { {email: "add_email@example.com"} } + let(:email_params) { { email: "add_email@example.com" } } it 'sends an email confirmation' do expect {post(:create, { email: email_params })}.to change { ActionMailer::Base.deliveries.size } @@ -18,7 +18,7 @@ describe Profiles::EmailsController do end describe '#resend_confirmation_instructions' do - let(:email_params) { {email: "add_email@example.com"} } + let(:email_params) { { email: "add_email@example.com" } } it 'resends an email confirmation' do email = user.emails.create(email: 'add_email@example.com') diff --git a/spec/models/gpg_key_spec.rb b/spec/models/gpg_key_spec.rb index 49c608b284f..067afc0182b 100644 --- a/spec/models/gpg_key_spec.rb +++ b/spec/models/gpg_key_spec.rb @@ -88,17 +88,17 @@ describe GpgKey do describe '#emails_with_verified_status' do it 'email is verified if the user has the matching email' do - user = create :user, email: 'bette.cartwright@example.com' + user = create :user, email: 'bette.cartwright@example.com' gpg_key = create :gpg_key, key: GpgHelpers::User2.public_key, user: user - email_unconfirmed = create :email, user: user + create :email, user: user user.reload expect(gpg_key.emails_with_verified_status).to eq( 'bette.cartwright@example.com' => true, - 'bette.cartwright@example.net' => false + 'bette.cartwright@example.net' => false ) - email_confirmed = create :email, :confirmed, user: user, email: 'bette.cartwright@example.net' + create :email, :confirmed, user: user, email: 'bette.cartwright@example.net' user.reload expect(gpg_key.emails_with_verified_status).to eq( 'bette.cartwright@example.com' => true, diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 45f0144f68e..a230f72449a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -409,14 +409,12 @@ describe User do end it 'transfers old confirmation values into new secondary' do - org_user = @user @user.update_attributes!(email: @secondary.email) @user.reload expect(@user.emails.count).to eq 1 expect(@user.emails.first.confirmed_at).not_to eq nil end end - end describe '#update_tracked_fields!', :clean_gitlab_redis_shared_state do @@ -1146,8 +1144,8 @@ describe User do let(:user) { create(:user) } it 'returns only confirmed emails' do - email_confirmed = create :email, user: user, confirmed_at: Time.now - email_unconfirmed = create :email, user: user + email_confirmed = create :email, user: user, confirmed_at: Time.now + create :email, user: user user.reload expect(user.verified_emails).to match_array([user.email, email_confirmed.email]) end @@ -1157,8 +1155,8 @@ describe User do let(:user) { create(:user) } it 'returns true when the email is verified/confirmed' do - email_confirmed = create :email, user: user, confirmed_at: Time.now - email_unconfirmed = create :email, user: user + email_confirmed = create :email, user: user, confirmed_at: Time.now + create :email, user: user user.reload expect(user.verified_email?(user.email)).to be_truthy |