spec/omniauth/strategies/auth0_spec.rb in omniauth-auth0-1.4.0 vs spec/omniauth/strategies/auth0_spec.rb in omniauth-auth0-1.4.1
- old
+ new
@@ -28,11 +28,11 @@
end
end
context "initiation" do
let(:base64_token) {
- Base64.urlsafe_encode64('{"name":"omniauth-auth0","version":"'+Auth0::VERSION+'"}')
+ Base64.urlsafe_encode64('{"name":"omniauth-auth0","version":"' + OmniAuth::Auth0::VERSION + '"}')
}
it "uses the correct site" do
expect(subject.options.client_options.site).to eql "https://tenny.auth0.com:3000"
end
@@ -160,8 +160,18 @@
:token_type => "bearer"
} }
expect(subject.credentials['token'][:access_token]).to eq('OTqSFa9zrh0VRGAZHH4QPJISCoynRwSy9FocUazuaU950EVcISsJo3pST11iTCiI')
expect(subject.credentials['token'][:token_type]).to eq('bearer')
end
+
+ it 'returns the refresh token' do
+ allow(@access_token).to receive(:refresh_token) { "your_refresh_token" }
+ allow(@access_token).to receive(:params) {
+ {
+ 'id_token' => "your_id_token",
+ 'token_type' => "your_token_type"
+ } }
+ expect(subject.credentials['refresh_token']).to eq('your_refresh_token')
+ end
end
end
-end
\ No newline at end of file
+end