|
18 | 18 | stub_request(:any, //).to_return(body: "Unknown Stub", status: 500) |
19 | 19 | end |
20 | 20 |
|
21 | | - it "set default headers" do |
22 | | - stub_request(:get, %r{/ping}).to_return { |request| { headers: request.headers, status: 200 } } |
| 21 | + it "does not smoke" do |
| 22 | + stub_request(:get, "http://localhost:4242/ping").to_return { |request| { headers: request.headers, status: 200 } } |
23 | 23 |
|
24 | | - client = QuickPay::API::Client.new |
| 24 | + client = QuickPay::API::Client.new(password: "secret", base_uri: "http://localhost:4242") |
25 | 25 | _, _, headers = *client.get("/ping") |
26 | 26 |
|
27 | 27 | _(headers["accept-version"]).must_equal "v10" |
28 | 28 | _(headers["user-agent"]).must_equal "quickpay-ruby-client, v#{QuickPay::API::VERSION}" |
29 | | - end |
30 | | - |
31 | | - it "handles authentication" do |
32 | | - stub_request(:get, %r{/ping}).to_return { |request| { headers: request.headers, status: 200 } } |
33 | | - |
34 | | - client = QuickPay::API::Client.new(password: "secret") |
35 | | - _, _, headers = *client.get("/ping") |
36 | | - |
37 | 29 | _(headers["authorization"]).must_equal "Basic OnNlY3JldA==" |
38 | 30 | end |
39 | 31 |
|
|
184 | 176 | _(e.request.body).must_equal "foo=bar&baz=qux" |
185 | 177 | _(e.request.headers["Accept-Version"]).must_equal "v10" |
186 | 178 | _(e.request.headers["User-Agent"]).must_equal "quickpay-ruby-client, v#{QuickPay::API::VERSION}" |
187 | | - _(e.request.query).must_equal(nil) |
| 179 | + _(e.request.query).must_be_nil |
188 | 180 |
|
189 | 181 | e = assert_raises QuickPay::API::Error do |
190 | 182 | stub_request(:post, %r{/upload}).to_return(status: 409, body: "Conflict", headers: { "Foo" => "bar" }) |
|
0 commit comments