Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull in fork test from hub #190

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion features/fork.feature
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,34 @@ Feature: hub fork
"""
When I successfully run `hub fork`
Then the output should contain exactly "new remote: mislav\n"
And "git remote add -f mislav [email protected]:mislav/dotfiles.git" should be run
And "git remote add -f mislav git://github.com/evilchelu/dotfiles.git" should be run
And "git remote set-url mislav [email protected]:mislav/dotfiles.git" should be run
And the url for "mislav" should be "[email protected]:mislav/dotfiles.git"

Scenario: Fork the repository when origin URL is private
Given the "origin" remote has url "[email protected]:evilchelu/dotfiles.git"
Given the GitHub API server:
"""
before do
unless request.env['HTTP_AUTHORIZATION'] == 'token OTOKEN'
status 401
json :message => "I haz fail!"
end
end

get('/repos/mislav/dotfiles') do
status 404
json :message => "I haz fail!"
end

post('/repos/evilchelu/dotfiles/forks') do
json :html_url => "https://github.com/mislav/coral/pull/12"
end
"""
When I successfully run `hub fork`
Then the output should contain exactly "new remote: mislav\n"
And "git remote add -f mislav ssh://[email protected]/evilchelu/dotfiles.git" should be run
And "git remote set-url mislav [email protected]:mislav/dotfiles.git" should be run
And the url for "mislav" should be "[email protected]:mislav/dotfiles.git"

Scenario: --no-remote
Expand Down