Skip to content

Commit 74300be

Browse files
committed
Add country to Authenticable
1 parent ea963ad commit 74300be

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/rpi_auth/models/authenticatable.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Authenticatable
66
extend ActiveSupport::Concern
77

88
PROFILE_KEYS = %w[
9+
country
910
country_code
1011
email
1112
email_verified

spec/rpi_auth/models/authenticatable_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class DummyUser
1010
subject { described_class.new }
1111

1212
it { is_expected.to respond_to(:user_id) }
13+
it { is_expected.to respond_to(:country) }
1314
it { is_expected.to respond_to(:country_code) }
1415
it { is_expected.to respond_to(:email) }
1516
it { is_expected.to respond_to(:name) }
@@ -32,6 +33,7 @@ class DummyUser
3233
email: 'test@example.com',
3334
name: 'Bodkin Van Horn',
3435
nickname: 'Hoos-Foos',
36+
country: 'Zimbabwe',
3537
country_code: 'ZW',
3638
picture: 'https://placecage.com/100/100',
3739
profile: 'https://my.raspberry.pi/profile/edit'
@@ -56,6 +58,7 @@ class DummyUser
5658
expect(omniauth_user.name).to eq('Bodkin Van Horn')
5759
expect(omniauth_user.nickname).to eq('Hoos-Foos')
5860
expect(omniauth_user.email).to eq('test@example.com')
61+
expect(omniauth_user.country).to eq('Zimbabwe')
5962
expect(omniauth_user.country_code).to eq('ZW')
6063
expect(omniauth_user.picture).to eq('https://placecage.com/100/100')
6164
expect(omniauth_user.profile).to eq('https://my.raspberry.pi/profile/edit')

0 commit comments

Comments
 (0)