module CcApiStub::Login
Public Class Methods
succeeds_to_find_uaa(domain="http://some-other-random-domain.com:8181")
click to toggle source
# 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 => "{\"token_endpoint\":\"https://uaa.localhost\"}" ) end
succeeds_to_login_as_admin()
click to toggle source
# File lib/cc_api_stub/login.rb, line 12 def succeeds_to_login_as_admin WebMock::API.stub_request(:post, %r{uaa.localhost/oauth/authorize}). to_return( :status => 302, :headers => {"Location" => "https://uaa.localhost/redirect/cf#access_token=sre-admin-access-token&token_type=bearer"} ) end