govdelivery-tms 0.8.8 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/govdelivery/tms/client.rb +2 -1
- data/lib/govdelivery/tms/version.rb +1 -1
- data/spec/client_spec.rb +4 -1
- 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: beaa9bf643b1ed8a2db0bebfcc0c303e1a9eec63
|
4
|
+
data.tar.gz: fa153c967d58070a3ee1cdc9a1d0777b8f7f2990
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30130e14bba971fd996209ea4918212be4bfcfea986a322ad68dc9c4d3ab246be61ea6dd78b6531e7fbc813563aa392125d083b27ef217e75c3582bf11f8818a
|
7
|
+
data.tar.gz: 179a63f71c4ad59a988d59b0ad1675d9fcc37cf2afa03084ef361fa16de91c45eb5ab6f5ffa32bc048325f2bedfc025422f159537849100ce86e25946178fcbe
|
@@ -4,7 +4,7 @@ class GovDelivery::TMS::Client
|
|
4
4
|
include GovDelivery::TMS::Util::HalLinkParser
|
5
5
|
include GovDelivery::TMS::CoreExt
|
6
6
|
|
7
|
-
attr_accessor :connection, :href, :api_root, :logger
|
7
|
+
attr_accessor :connection, :href, :api_root, :logger, :sid
|
8
8
|
|
9
9
|
DEFAULTS = { api_root: 'https://tms.govdelivery.com', logger: nil }.freeze
|
10
10
|
|
@@ -35,6 +35,7 @@ class GovDelivery::TMS::Client
|
|
35
35
|
|
36
36
|
def discover!
|
37
37
|
services = get('/').body
|
38
|
+
self.sid = services['sid']
|
38
39
|
parse_links(services['_links'])
|
39
40
|
end
|
40
41
|
|
data/spec/client_spec.rb
CHANGED
@@ -2,11 +2,14 @@ require 'spec_helper'
|
|
2
2
|
describe GovDelivery::TMS::Client do
|
3
3
|
context 'creating a new client' do
|
4
4
|
before do
|
5
|
-
response = double('response', status: 200, body: { '_links' => [{ 'self' => '/' }, { 'horse' => '/horses/new' }, { 'rabbits' => '/rabbits' }] })
|
5
|
+
response = double('response', status: 200, body: {'sid' => 'abcd12345', '_links' => [{ 'self' => '/' }, { 'horse' => '/horses/new' }, { 'rabbits' => '/rabbits' }] })
|
6
6
|
@raw_connection = double('raw_connection', get: response)
|
7
7
|
@connection = allow(GovDelivery::TMS::Connection).to receive(:new).and_return(double('connection', connection: @raw_connection))
|
8
8
|
@client = GovDelivery::TMS::Client.new('auth_token', api_root: 'null_url')
|
9
9
|
end
|
10
|
+
it 'should populate sid' do
|
11
|
+
expect(@client.sid).to eq 'abcd12345'
|
12
|
+
end
|
10
13
|
it 'should set up logging' do
|
11
14
|
expect(@client.logger).not_to be_nil
|
12
15
|
expect(@client.logger.level).to eq(Logger::INFO)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govdelivery-tms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GovDelivery
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|