adds Identity model and migration
This commit is contained in:
9
spec/models/identity_spec.rb
Normal file
9
spec/models/identity_spec.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Identity, type: :model do
|
||||
let(:identity) { build(:identity) }
|
||||
|
||||
it "should be valid" do
|
||||
expect(identity).to be_valid
|
||||
end
|
||||
end
|
||||
@@ -50,6 +50,26 @@ describe User do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'OmniAuth' do
|
||||
describe '#email_provided?' do
|
||||
it "is false if the email matchs was temporarely assigned by the OmniAuth process" do
|
||||
subject.email = 'omniauth@participacion-ABCD-twitter.com'
|
||||
expect(subject.email_provided?).to eq(false)
|
||||
end
|
||||
|
||||
it "is true if the email is not omniauth-like" do
|
||||
subject.email = 'manuelacarmena@example.com'
|
||||
expect(subject.email_provided?).to eq(true)
|
||||
end
|
||||
|
||||
it "is true if the user's real email is pending to be confirmed" do
|
||||
subject.email = 'omniauth@participacion-ABCD-twitter.com'
|
||||
subject.unconfirmed_email = 'manuelacarmena@example.com'
|
||||
expect(subject.email_provided?).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "administrator?" do
|
||||
it "is false when the user is not an admin" do
|
||||
expect(subject.administrator?).to be false
|
||||
|
||||
Reference in New Issue
Block a user