socialcast 1.3.10 → 1.3.11
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6def41c8c9fc333d5375b7e0ad9b403594663dd
|
4
|
+
data.tar.gz: 70370fc44d5b564bb69911a6b1919811bbf95b9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22d41b04fa02c612b5a4486a7f7c1898bda5647e690a5054bb28e42e0438613f3b0acb6478b5ec668cce3daf37e9f9f7a9278d2eb0a506b9e1cddb9880290020
|
7
|
+
data.tar.gz: a2738fb5abcfefe29222c4dd85dca607f114f99ff08cc89073205210dcc616caf8f395061191ddafd36c1b4ea6da4fc7210407bdb9734f6bba82014bfe8e2c81
|
@@ -53,7 +53,7 @@ module Socialcast
|
|
53
53
|
params = { :email => user, :password => password }
|
54
54
|
response = Socialcast::CommandLine::Authenticate.new(:user, options, params).request
|
55
55
|
communities = JSON.parse(response.body.to_s)['communities']
|
56
|
-
domain = communities.detect {|c| c['domain'] == domain} ? domain : communities.first['domain']
|
56
|
+
domain = communities.detect { |c| c['domain'] == options[:domain] } ? options[:domain] : communities.first['domain']
|
57
57
|
|
58
58
|
Socialcast::CommandLine.credentials = {
|
59
59
|
:user => user,
|
@@ -47,24 +47,40 @@ describe Socialcast::CommandLine::CLI do
|
|
47
47
|
describe '#authenticate' do
|
48
48
|
let(:user) { 'mike@socialcast.com' }
|
49
49
|
let(:password) { 'password' }
|
50
|
-
let(:
|
50
|
+
let(:default_domain) { 'api.socialcast.com' }
|
51
|
+
let(:first_tenant_domain) { 'test1.socialcast.com' }
|
52
|
+
let(:second_tenant_domain) { 'test2.socialcast.com' }
|
51
53
|
before do
|
52
54
|
Socialcast::CommandLine.should_receive(:credentials=).with({
|
53
|
-
:domain =>
|
55
|
+
:domain => default_domain,
|
54
56
|
:proxy => nil
|
55
57
|
})
|
56
58
|
Socialcast::CommandLine.should_receive(:credentials=).with({
|
57
59
|
:user => user,
|
58
60
|
:password => password,
|
59
|
-
:domain =>
|
61
|
+
:domain => domain_to_set
|
60
62
|
})
|
61
|
-
stub_request(:post, "https
|
63
|
+
stub_request(:post, "https://#{default_domain}/api/authentication").
|
62
64
|
with(:body => {"email"=>"mike@socialcast.com", "password"=>"password"}).
|
63
|
-
to_return(:status => 200, :body => { :communities => [{ :domain => domain }] }.to_json, :headers => {})
|
64
|
-
|
65
|
+
to_return(:status => 200, :body => { :communities => [ { :domain => first_tenant_domain }, { :domain => second_tenant_domain }] }.to_json, :headers => {})
|
66
|
+
end
|
67
|
+
context 'when passed a domain directly' do
|
68
|
+
let(:domain_to_set) { second_tenant_domain }
|
69
|
+
let(:default_domain) { second_tenant_domain }
|
70
|
+
before do
|
71
|
+
Socialcast::CommandLine::CLI.start ['authenticate', "--user=#{user}", "--password=#{password}", "--domain=#{second_tenant_domain}"]
|
72
|
+
end
|
73
|
+
#See expectations
|
74
|
+
it 'authenticates with the API and sets the domain to the domain passed as an option' do end
|
75
|
+
end
|
76
|
+
context 'when not passed a domain it chooses the first domain returned from the response' do
|
77
|
+
let(:domain_to_set) { first_tenant_domain }
|
78
|
+
before do
|
79
|
+
Socialcast::CommandLine::CLI.start ['authenticate', "--user=#{user}", "--password=#{password}"]
|
80
|
+
end
|
81
|
+
## See expectations
|
82
|
+
it 'authenticates with the API and sets the domain to the first domain returned' do end
|
65
83
|
end
|
66
|
-
## See expectations
|
67
|
-
it 'authenticates with the API and sets the given credentials' do end
|
68
84
|
end
|
69
85
|
|
70
86
|
describe '#authenticate_external_system' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialcast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Sonnek
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-06-
|
13
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|