Skip to content

Commit 15fa2b5

Browse files
committed
specs
1 parent 4af5d2c commit 15fa2b5

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

spec/omniauth/strategies/okta_spec.rb

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'spec_helper'
24

35
describe OmniAuth::Strategies::Okta do
@@ -41,13 +43,9 @@
4143
end
4244
end
4345

44-
describe '#scope' do
45-
it { expect(subject.authorize_params[:scope]).to eq('email') }
46-
end
47-
4846
describe '#uid' do
4947
before :each do
50-
# allow(subject).to receive(:raw_info) { { 'id' => 'uid' } }
48+
allow(subject).to receive(:raw_info) { { 'sub' => 'uid' } }
5149
end
5250

5351
it 'returns the id from raw_info' do
@@ -60,19 +58,26 @@
6058
allow(subject).to receive(:raw_info) { {} }
6159
end
6260

63-
context 'and therefore has all the necessary fields' do
61+
context 'has the necessary fields' do
6462
it { expect(subject.info).to have_key :name }
6563
it { expect(subject.info).to have_key :email }
66-
it { expect(subject.info).to have_key :nickname }
6764
it { expect(subject.info).to have_key :first_name }
6865
it { expect(subject.info).to have_key :last_name }
69-
it { expect(subject.info).to have_key :location }
70-
it { expect(subject.info).to have_key :description }
7166
it { expect(subject.info).to have_key :image }
72-
it { expect(subject.info).to have_key :urls }
7367
end
7468
end
7569

76-
describe '#extra' do
70+
describe 'extra' do
71+
before :each do
72+
allow(subject).to receive(:raw_info) { { :foo => 'bar' } }
73+
end
74+
75+
it { expect(subject.extra['raw_info']).to eq({ :foo => 'bar' }) }
76+
end
77+
78+
describe 'id_token' do
79+
end
80+
81+
describe 'raw_info' do
7782
end
7883
end

spec/spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'rspec'
24
require 'rack/test'
35
require 'omniauth'

0 commit comments

Comments
 (0)