omniauth-applicaster 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applicaster/accounts.rb +2 -0
- data/lib/omniauth-applicaster/version.rb +1 -1
- data/spec/lib/applicaster/accounts_spec.rb +26 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6945c3ae7d17b5590097a6a467a13234a2705355
|
4
|
+
data.tar.gz: 208431d82e39cc7d9de00343062b119a4a7f2b88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 091d23f2dfdc715f35a7b5febf18a604c07dd2852b9c8ab94de2af4815745ceb7f90dc48e84402e273b54e9395b752bf707d228e245d9d3764d4f22044384788
|
7
|
+
data.tar.gz: c9286e01668134507bc8d3fafdceaf7ca8eb27013ee75d3349f47bc271188ebdcc61eb04c654c47fc09d935bce96fb9df782185682ebe11e36280ebf289b3cfd
|
data/lib/applicaster/accounts.rb
CHANGED
@@ -191,16 +191,36 @@ RSpec.describe Applicaster::Accounts do
|
|
191
191
|
end
|
192
192
|
|
193
193
|
describe "#find_user_by_id" do
|
194
|
-
let(:user_id) { 11 }
|
195
|
-
|
196
194
|
before do
|
197
195
|
stub_client_credentials_request
|
198
|
-
stub_user_show_request(user_id, "client-credentials-token")
|
199
196
|
end
|
200
197
|
|
201
|
-
|
202
|
-
|
203
|
-
|
198
|
+
context "when accounts service returns 200" do
|
199
|
+
let(:user_id) { 11 }
|
200
|
+
|
201
|
+
before do
|
202
|
+
stub_user_show_request(user_id, "client-credentials-token")
|
203
|
+
end
|
204
|
+
|
205
|
+
it "returns User object" do
|
206
|
+
expect(accounts_service.find_user_by_id(user_id))
|
207
|
+
.to be_kind_of(Applicaster::Accounts::User)
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
context "when accounts service returns 404" do
|
212
|
+
let(:user_id) { "wrong-id" }
|
213
|
+
|
214
|
+
before do
|
215
|
+
stub_request(:get, "https://#{accounts_host}/api/v1/users/#{user_id}.json").
|
216
|
+
with(query: { access_token: "client-credentials-token" }).
|
217
|
+
to_return(status: 404, body: "")
|
218
|
+
end
|
219
|
+
|
220
|
+
it "doesn't raise" do
|
221
|
+
expect{ accounts_service.find_user_by_id(user_id) }
|
222
|
+
.to_not raise_error
|
223
|
+
end
|
204
224
|
end
|
205
225
|
end
|
206
226
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-applicaster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neer Friedman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|