-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from RaspberryPiFoundation/add-username-to-str…
…ategy Add username to v0 strategy
- Loading branch information
Showing
5 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module OmniAuth | ||
module Rpi | ||
VERSION = '0.6.0'.freeze | ||
VERSION = '0.7.0'.freeze | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
module RpiAuthBypass | ||
DEFAULT_UID = 'b6301f34-b970-4d4f-8314-f877bad8b150' | ||
DEFAULT_EMAIL = '[email protected]' | ||
DEFAULT_USERNAME = 'webteam' | ||
DEFAULT_NAME = 'Web Team' | ||
DEFAULT_NICKNAME = 'Web' | ||
DEFAULT_PROFILE = 'https://profile.raspberrypi.org/not/a/real/path' | ||
|
@@ -15,6 +16,7 @@ module RpiAuthBypass | |
name: DEFAULT_NAME, | ||
nickname: DEFAULT_NICKNAME, | ||
email: DEFAULT_EMAIL, | ||
username: DEFAULT_USERNAME, | ||
image: DEFAULT_IMAGE, | ||
}.freeze | ||
DEFAULT_EXTRA = { | ||
|
@@ -23,6 +25,7 @@ module RpiAuthBypass | |
name: DEFAULT_NAME, | ||
nickname: DEFAULT_NICKNAME, | ||
email: DEFAULT_EMAIL, | ||
username: DEFAULT_USERNAME, | ||
country: DEFAULT_COUNTRY, | ||
country_code: DEFAULT_COUNTRY_CODE, | ||
postcode: DEFAULT_POSTCODE, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,10 @@ | |
expect(subject.info.email).to eq(RpiAuthBypass::DEFAULT_EMAIL) | ||
end | ||
|
||
it 'has the default username' do | ||
expect(subject.info.username).to eq(RpiAuthBypass::DEFAULT_USERNAME) | ||
end | ||
|
||
it 'has the default name' do | ||
expect(subject.info.name).to eq(RpiAuthBypass::DEFAULT_NAME) | ||
end | ||
|
@@ -86,17 +90,19 @@ | |
let(:name) { 'Robert Flemming' } | ||
let(:nickname) { 'Bob' } | ||
let(:email) { '[email protected]' } | ||
let(:username) { 'bob.flemming' } | ||
let(:roles) { 'gardener' } | ||
let(:image) { 'https://my.avatar.com/image/1' } | ||
let(:profile) { 'https://my.user.com/profile/1' } | ||
let(:country) { 'United States' } | ||
let(:country_code) { 'US' } | ||
let(:postcode) { '123456' } | ||
|
||
let(:info) { { name: name, email: email, nickname: nickname, image: image } } | ||
let(:info) { { name: name, email: email, username: username, nickname: nickname, image: image } } | ||
let(:extra) { { raw_info: { | ||
name: name, | ||
email: email, | ||
username: username, | ||
nickname: nickname, | ||
roles: roles, | ||
avatar: image, | ||
|
@@ -115,6 +121,10 @@ | |
expect(subject.info.email).to eq(email) | ||
end | ||
|
||
it 'has the username from info' do | ||
expect(subject.info.username).to eq(username) | ||
end | ||
|
||
it 'has the name from info' do | ||
expect(subject.info.name).to eq(name) | ||
end | ||
|
@@ -131,6 +141,10 @@ | |
expect(subject.extra.raw_info.email).to eq(email) | ||
end | ||
|
||
it 'has the username from extra' do | ||
expect(subject.extra.raw_info.username).to eq(username) | ||
end | ||
|
||
it 'has the name from extra' do | ||
expect(subject.extra.raw_info.name).to eq(name) | ||
end | ||
|