Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 64 lines (56 sloc) 2.576 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
Feature: List gems API
In order to see all the gems I work on
A gem owner
Should be able to list their gems

Scenario: Anonymous user lists gems for owner
Given the following user exists:
| email | handle |
| user@example.com | myhandle |
And the following version exists:
| rubygem | number |
| name: AGem | 1.0.0 |
And the following ownership exists:
| rubygem | user |
| name: AGem | email: user@example.com |
| name: BGem | |
When I list the gems for owner "myhandle"
Then I should see "AGem"
And I should not see "BGem"

Scenario: Anonymous user lists gems for unknown user
When I list the gems for owner "nobody"
Then I should see "Owner could not be found."

Scenario: Gem owner user lists their gems
Given I am signed up as "original@owner.org"
And I have an API key for "original@owner.org/password"
And the following version exists:
| rubygem | number |
| name: MyGem | 1.0.0 |
And the following ownership exists:
| rubygem | user |
| name: MyGem | email: original@owner.org |
When I list the gems with my API key
Then I should see "MyGem"

Scenario: Gem versions include all gem version data
Given the following version exists:
| rubygem | number | licenses |
| name: testgemwithlicense | 1.0.0 | MIT |
When I GET "/api/v1/versions/testgemwithlicense.json"
Then the JSON response should include all of the gem version metadata

Scenario: Gem has MIT license
Given the following version exists:
| rubygem | number | licenses |
| name: testgemwithmitlicense | 1.0.0 | MIT |
When I GET "/api/v1/versions/testgemwithmitlicense.json"
Then the returned JSON should include licenses:MIT

Scenario: Gem has dual (MIT/Proprietary) licenses
Given the following version exists:
| rubygem | number | licenses |
| name: testgemwithduallicenses | 1.0.0 | MIT,Proprietary |
When I GET "/api/v1/versions/testgemwithduallicenses.json"
Then the returned JSON should include licenses:GPLv2,Proprietary

Scenario: Gem has no license
Given the following version exists:
| rubygem | number | licenses |
| name: testgemwithnolicense | 1.0.0 | |
When I GET "/api/v1/versions/testgemwithnolicense.json"
Then the returned JSON should include licenses:
Something went wrong with that request. Please try again.