Skip to content

Commit a545c46

Browse files
committed
Remove expects(:token).never assertion
The test already verifies correct behavior via WebMock: stub_request(:get, url).with(basic_auth: [...]) If set_auth_from_token! incorrectly runs, it overwrites the Authorization header with "token ...", which won't match the basic_auth expectation and WebMock rejects the request. Originally added in 39f2d9e.
1 parent 7e813a7 commit a545c46

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

test/git_hub_bub/valid_token_test.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ def test_does_not_add_token_to_header
1212
VCR.turned_off do
1313
token = "foo"
1414
url = "https://api.github.com/applications/#{ENV["GITHUB_APP_ID"]}/tokens/#{token}"
15+
# Add a basic auth header, will fail if `'Authorization'=>'token ...'` header is added by mistake
1516
stub_get = stub_request(:get, url).with(basic_auth: [ENV["GITHUB_APP_ID"], ENV["GITHUB_APP_SECRET"]])
1617

17-
GitHubBub::Request.any_instance.expects(:token).never
18-
1918
GitHubBub::Request.set_before_callback do |request|
2019
if request.token?
2120
# Should be true for this call

0 commit comments

Comments
 (0)