github.com/pengwynn/gh@v1.0.1-0.20140118055701-14327ca3942e/features/browse.feature (about)

     1  Feature: hub browse
     2    Background:
     3      Given I am "mislav" on github.com with OAuth token "OTOKEN"
     4  
     5    Scenario: Project with owner
     6      When I successfully run `hub browse -p mislav/dotfiles`
     7      Then there should be no output
     8      And "open https://github.com/mislav/dotfiles" should be run
     9  
    10    Scenario: Project without owner
    11      Given I am "mislav" on github.com
    12      When I successfully run `hub browse -p dotfiles`
    13      Then "open https://github.com/mislav/dotfiles" should be run
    14  
    15    Scenario: Explicit project overrides current
    16      Given I am in "git://github.com/josh/rails-behaviors.git" git repo
    17      And I am "mislav" on github.com
    18      When I successfully run `hub browse -p dotfiles`
    19      Then "open https://github.com/mislav/dotfiles" should be run
    20  
    21    Scenario: Project issues
    22      When I successfully run `hub browse -p mislav/dotfiles issues`
    23      Then "open https://github.com/mislav/dotfiles/issues" should be run
    24  
    25    Scenario: Project wiki
    26      When I successfully run `hub browse -p mislav/dotfiles wiki`
    27      Then "open https://github.com/mislav/dotfiles/wiki" should be run
    28  
    29    Scenario: Project commits on master
    30      When I successfully run `hub browse -p mislav/dotfiles commits`
    31      Then "open https://github.com/mislav/dotfiles/commits/master" should be run
    32  
    33    Scenario: Specific commit in project
    34      When I successfully run `hub browse -p mislav/dotfiles commit/4173c3b`
    35      Then "open https://github.com/mislav/dotfiles/commit/4173c3b" should be run
    36  
    37    Scenario: Output the URL instead of browse
    38      When I successfully run `hub browse -u -p mislav/dotfiles`
    39      Then the output should contain exactly "https://github.com/mislav/dotfiles\n"
    40      But "open https://github.com/mislav/dotfiles" should not be run
    41  
    42    Scenario: Current project
    43      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    44      When I successfully run `hub browse`
    45      Then there should be no output
    46      And "open https://github.com/mislav/dotfiles" should be run
    47  
    48    Scenario: Commit in current project
    49      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    50      When I successfully run `hub browse commit/abcd1234`
    51      Then "open https://github.com/mislav/dotfiles/commit/abcd1234" should be run
    52  
    53    Scenario: Current branch
    54      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    55      And git "push.default" is set to "upstream"
    56      And I am on the "feature" branch with upstream "origin/experimental"
    57      When I successfully run `hub browse`
    58      Then "open https://github.com/mislav/dotfiles/tree/experimental" should be run
    59  
    60    Scenario: Default branch
    61      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    62      And the default branch for "origin" is "develop"
    63      And I am on the "develop" branch with upstream "origin/develop"
    64      When I successfully run `hub browse`
    65      Then "open https://github.com/mislav/dotfiles" should be run
    66  
    67    Scenario: Current branch, no tracking
    68      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    69      And I am on the "feature" branch
    70      When I successfully run `hub browse`
    71      Then "open https://github.com/mislav/dotfiles" should be run
    72  
    73    Scenario: Current branch with special chars
    74      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    75      And I am on the "fix-bug-#123" branch with upstream "origin/fix-bug-#123"
    76      When I successfully run `hub browse`
    77      Then "open https://github.com/mislav/dotfiles/tree/fix-bug-%23123" should be run
    78  
    79    Scenario: Commits on current branch
    80      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    81      And git "push.default" is set to "upstream"
    82      And I am on the "feature" branch with upstream "origin/experimental"
    83      When I successfully run `hub browse commits`
    84      Then "open https://github.com/mislav/dotfiles/commits/experimental" should be run
    85  
    86    Scenario: Complex branch
    87      Given I am in "git://github.com/mislav/dotfiles.git" git repo
    88      And git "push.default" is set to "upstream"
    89      And I am on the "foo/bar" branch with upstream "origin/baz/qux/moo"
    90      When I successfully run `hub browse`
    91      Then "open https://github.com/mislav/dotfiles/tree/baz/qux/moo" should be run
    92  
    93    Scenario: Wiki repo
    94      Given I am in "git://github.com/defunkt/hub.wiki.git" git repo
    95      When I successfully run `hub browse`
    96      Then "open https://github.com/defunkt/hub/wiki" should be run
    97  
    98    Scenario: Wiki commits
    99      Given I am in "git://github.com/defunkt/hub.wiki.git" git repo
   100      When I successfully run `hub browse commits`
   101      Then "open https://github.com/defunkt/hub/wiki/_history" should be run
   102  
   103    Scenario: Wiki pages
   104      Given I am in "git://github.com/defunkt/hub.wiki.git" git repo
   105      When I successfully run `hub browse pages`
   106      Then "open https://github.com/defunkt/hub/wiki/_pages" should be run
   107  
   108    @wip
   109    Scenario: Deprecated -p flag
   110      When I successfully run `hub browse -p defunkt/hub`
   111      Then the stderr should contain exactly:
   112        """
   113        Warning: the `-p` flag has no effect anymore\n
   114        """
   115      But "open https://github.com/defunkt/hub" should be run