cf-uaa-lib 1.3.9 → 1.3.10

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ doc/
6
6
  coverage/
7
7
  spec_reports/
8
8
  vendor/
9
+ .idea
@@ -69,7 +69,7 @@ class Misc
69
69
  def self.discover_uaa(target)
70
70
  info = server(target)
71
71
  links = info['links'] || info[:links]
72
- uaa = links['uaa'] || links[:uaa]
72
+ uaa = links && (links['uaa'] || links[:uaa])
73
73
 
74
74
  uaa || target
75
75
  end
@@ -14,6 +14,6 @@
14
14
  # Cloud Foundry namespace
15
15
  module CF
16
16
  module UAA
17
- VERSION = "1.3.9"
17
+ VERSION = "1.3.10"
18
18
  end
19
19
  end
@@ -68,6 +68,15 @@ module CF::UAA
68
68
  result.should == "https://uaa.cloudfoundry.com"
69
69
  end
70
70
 
71
+ context "when there is no 'links' key present" do
72
+ let(:response_body) { '{ "prompts" : ["one","two"]} ' }
73
+
74
+ it "returns the login url" do
75
+ result = Misc.discover_uaa("https://login.cloudfoundry.com")
76
+ result.should == "https://login.cloudfoundry.com"
77
+ end
78
+ end
79
+
71
80
  context "with symbol keys" do
72
81
  around do |example|
73
82
  CF::UAA::Misc.symbolize_keys = true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cf-uaa-lib
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 9
10
- version: 1.3.9
9
+ - 10
10
+ version: 1.3.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dave Syer