nexaas_id-client 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7dba0636a5ef5cd0279be78dbab7ee836e995a50f73be0dbb3c2195742db35c
4
- data.tar.gz: 7f5a5e5e133db3f5c8702ba4e11a1545d74f37355de0ad91dfd7260c721a212c
3
+ metadata.gz: 514641b029e1c683b93818a9ac35ce4ad01969d80d51ce50ef97023e35d0dff9
4
+ data.tar.gz: dd10b848d5d02a3c8b44c3f7b050839847ad20049f229cdb299cd0bcbc40570c
5
5
  SHA512:
6
- metadata.gz: 46cc9b29c4ffdf03c4cbd931de93a52297714a2e280ddddd1bceaef452a2a0fffd6e0753cd796c2720791f2aa7933f34849f836668f0d24583f9e372c69501c5
7
- data.tar.gz: 0bd625171195ba87a1b5afcbbfb9a85954f7e73db67250186036e2d254daabac07cfbceebb8f2ad93336565ed6206c384db737b331d6a7b87640d84dc82705b3
6
+ metadata.gz: bd58dcbaa0e7a23d512252be729ca3335bf9b54ed3592e122d2a5257317600bd884c5bb499c4215a6af8d72ea38dc9a923e7d5b969dacb9aea9cd46c0d232ba7
7
+ data.tar.gz: 81b0e19df9ff7ceda3a0f95c413358abdac532f5cc40234e7ae8238376d696f8decd6a28e54d2b7200bbf9cdb07306201da24b29ad3da3ea6bddcb7bb6989f9a
data/README.md CHANGED
@@ -8,7 +8,7 @@ This is the official Ruby client for the [Nexaas ID](https://id.nexaas.com) API.
8
8
  [![Code Climate Grade](https://codeclimate.com/github/myfreecomm/nexaas-id-client-ruby.png)](https://codeclimate.com/github/myfreecomm/nexaas-id-client-ruby)
9
9
  [![Inline docs](http://inch-ci.org/github/myfreecomm/nexaas-id-client-ruby.svg)](http://inch-ci.org/github/myfreecomm/nexaas-id-client-ruby)
10
10
 
11
- Nexaas ID API docs: https://id.nexaas.com/static/docs/
11
+ Nexaas ID API docs: https://docs.id.nexaas.com/
12
12
 
13
13
  nexaas-id-client-ruby RDoc documentation: http://rubydoc.info/github/myfreecomm/nexaas-id-client-ruby/frames/
14
14
 
@@ -13,7 +13,6 @@
13
13
  #
14
14
  # @see NexaasID::Client::Identity#initialize
15
15
  class NexaasID::Resources::Widget < NexaasID::Resources::Base
16
-
17
16
  # Retrieves the user's navbar URL
18
17
  #
19
18
  # [API]
@@ -25,4 +24,16 @@ class NexaasID::Resources::Widget < NexaasID::Resources::Base
25
24
  def navbar_url
26
25
  %(#{configuration.url}/api/v1/widgets/navbar?access_token=#{api.token})
27
26
  end
27
+
28
+ # Retrieves the user's widget URL
29
+ #
30
+ # [API]
31
+ # Method: <tt>GET /api/v1/widgets/user</tt>
32
+ #
33
+ # Documentation:
34
+ #
35
+ # @return [String] user's widget URL
36
+ def widget_url(callback = 'initWidget')
37
+ %(#{configuration.url}/api/v1/widgets/user.js?access_token=#{api.token}&callback=#{callback})
38
+ end
28
39
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module NexaasID
3
- VERSION = "0.7.0".freeze
3
+ VERSION = "0.7.1".freeze
4
4
  end
@@ -21,4 +21,16 @@ describe NexaasID::Resources::Widget do
21
21
  end
22
22
  end
23
23
  end
24
+
25
+ describe "widget_url" do
26
+ subject { resource.widget_url }
27
+ let(:regexp) { %r(#{Regexp.quote(configuration.url)}/api/v1/widgets/user.js\?access_token=(.+?)&callback=initWidget$) }
28
+
29
+ it 'returns the navbar url for this user' do
30
+ VCR.use_cassette('identity/widget/widget_url/success') do
31
+ expect(subject).to match(regexp)
32
+ expect(Faraday.get(subject).status).to eq(200)
33
+ end
34
+ end
35
+ end
24
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexaas_id-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Tassinari de Oliveira
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-10-23 00:00:00.000000000 Z
14
+ date: 2018-10-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json