Skip to content

Commit 0e6ee5e

Browse files
chore: test stubs to include API key
1 parent 8241779 commit 0e6ee5e

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GIT
1111
PATH
1212
remote: .
1313
specs:
14-
onebusaway-sdk (0.1.0.pre.alpha.207)
14+
onebusaway-sdk (0.1.0.pre.alpha.208)
1515
connection_pool
1616

1717
GEM

test/onebusaway_sdk/client_test.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_raises_on_missing_non_nullable_opts
3535
end
3636

3737
def test_client_default_request_default_retry_attempts
38-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
38+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
3939
status: 500,
4040
body: {}
4141
)
@@ -50,7 +50,7 @@ def test_client_default_request_default_retry_attempts
5050
end
5151

5252
def test_client_given_request_default_retry_attempts
53-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
53+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
5454
status: 500,
5555
body: {}
5656
)
@@ -66,7 +66,7 @@ def test_client_given_request_default_retry_attempts
6666
end
6767

6868
def test_client_default_request_given_retry_attempts
69-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
69+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
7070
status: 500,
7171
body: {}
7272
)
@@ -81,7 +81,7 @@ def test_client_default_request_given_retry_attempts
8181
end
8282

8383
def test_client_given_request_given_retry_attempts
84-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
84+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
8585
status: 500,
8686
body: {}
8787
)
@@ -97,7 +97,7 @@ def test_client_given_request_given_retry_attempts
9797
end
9898

9999
def test_client_retry_after_seconds
100-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
100+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
101101
status: 500,
102102
headers: {"retry-after" => "1.3"},
103103
body: {}
@@ -115,7 +115,7 @@ def test_client_retry_after_seconds
115115
end
116116

117117
def test_client_retry_after_date
118-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
118+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
119119
status: 500,
120120
headers: {"retry-after" => (Time.now + 10).httpdate},
121121
body: {}
@@ -135,7 +135,7 @@ def test_client_retry_after_date
135135
end
136136

137137
def test_client_retry_after_ms
138-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
138+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
139139
status: 500,
140140
headers: {"retry-after-ms" => "1300"},
141141
body: {}
@@ -153,7 +153,7 @@ def test_client_retry_after_ms
153153
end
154154

155155
def test_retry_count_header
156-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
156+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
157157
status: 500,
158158
body: {}
159159
)
@@ -170,7 +170,7 @@ def test_retry_count_header
170170
end
171171

172172
def test_omit_retry_count_header
173-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
173+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
174174
status: 500,
175175
body: {}
176176
)
@@ -187,7 +187,7 @@ def test_omit_retry_count_header
187187
end
188188

189189
def test_overwrite_retry_count_header
190-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
190+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
191191
status: 500,
192192
body: {}
193193
)
@@ -204,7 +204,7 @@ def test_overwrite_retry_count_header
204204
end
205205

206206
def test_client_redirect_307
207-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
207+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
208208
status: 307,
209209
headers: {"location" => "/redirected"},
210210
body: {}
@@ -233,7 +233,7 @@ def test_client_redirect_307
233233
end
234234

235235
def test_client_redirect_303
236-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
236+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
237237
status: 303,
238238
headers: {"location" => "/redirected"},
239239
body: {}
@@ -257,7 +257,7 @@ def test_client_redirect_303
257257
end
258258

259259
def test_client_redirect_auth_keep_same_origin
260-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
260+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
261261
status: 307,
262262
headers: {"location" => "/redirected"},
263263
body: {}
@@ -284,7 +284,7 @@ def test_client_redirect_auth_keep_same_origin
284284
end
285285

286286
def test_client_redirect_auth_strip_cross_origin
287-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
287+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
288288
status: 307,
289289
headers: {"location" => "https://example.com/redirected"},
290290
body: {}
@@ -307,7 +307,7 @@ def test_client_redirect_auth_strip_cross_origin
307307
end
308308

309309
def test_default_headers
310-
stub_request(:get, "http://localhost/api/where/current-time.json?key").to_return_json(
310+
stub_request(:get, "http://localhost/api/where/current-time.json?key=My%20API%20Key").to_return_json(
311311
status: 200,
312312
body: {}
313313
)

0 commit comments

Comments
 (0)