Module: CcApiStub::Login

Defined in:
lib/cc_api_stub/login.rb

Class Method Summary collapse

Class Method Details

.succeeds_to_find_uaa(domain = "http://some-other-random-domain.com:8181") ⇒ Object



4
5
6
7
8
9
10
# File 'lib/cc_api_stub/login.rb', line 4

def succeeds_to_find_uaa(domain="http://some-other-random-domain.com:8181")
  WebMock::API.stub_request(:get, "#{domain}/info").
    to_return(
      :status => 200,
      :body => "{\"authorization_endpoint\":\"https://uaa.localhost\"}"
    )
end

.succeeds_to_login_as_adminObject



12
13
14
15
16
17
18
# File 'lib/cc_api_stub/login.rb', line 12

def 
  WebMock::API.stub_request(:post, %r{uaa.localhost/oauth/authorize}).
    to_return(
      :status => 302,
      :headers => {"Location" => "https://uaa.localhost/redirect/vmc#access_token=sre-admin-access-token&token_type=bearer"}
    )
end