-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for special characters during authentication
references #407
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,3 +126,28 @@ Feature: OAuth authentication | |
Then the output should contain "two-factor authentication code:" | ||
And the exit status should be 0 | ||
And the file "../home/.config/hub" should contain "oauth_token: OTOKEN" | ||
|
||
Scenario: Special characters in username & password | ||
Given the GitHub API server: | ||
""" | ||
require 'rack/auth/basic' | ||
get('/authorizations') { '[]' } | ||
post('/authorizations') { | ||
auth = Rack::Auth::Basic::Request.new(env) | ||
halt 401 unless auth.credentials == [ | ||
'mislav:[email protected]', | ||
'my pass@phrase ok?' | ||
] | ||
json :token => 'OTOKEN' | ||
} | ||
get('/user') { | ||
json :login => 'mislav' | ||
} | ||
post('/user/repos') { | ||
json :full_name => 'mislav/dotfiles' | ||
} | ||
""" | ||
When I run `hub create` interactively | ||
When I type "mislav:[email protected]" | ||
And I type "my pass@phrase ok?" | ||
Then the exit status should be 0 |