-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
1,299 additions
and
68 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
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
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@vcr | ||
Feature: Get JSON | ||
|
||
Background: | ||
Given I send and accept JSON | ||
|
||
Scenario: Get JSON for a repo | ||
When I send a GET request to "snake" | ||
Then the response status should be "200" | ||
And the JSON response should have "$[0]name" with the text "feeds" | ||
And the JSON response should have "$[1]type" with the text "graph" | ||
|
||
Scenario: Get JSON for a dataset | ||
When I send a GET request to "catface/flea-treatment" | ||
Then the response status should be "200" | ||
And the JSON response should have "$.title" with the text "Flea Treatment" | ||
And the JSON response should have "$.data[0].Date" with the text "2015-12-03" |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Given /^I accept CSV$/ do | ||
add_headers( | ||
{ | ||
'Accept' => 'text/csv' | ||
} | ||
) | ||
end |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require 'vcr' | ||
require 'webmock/cucumber' | ||
|
||
VCR.configure do |c| | ||
c.default_cassette_options = { :record => :once } | ||
c.cassette_library_dir = 'features/support/vcr' | ||
c.hook_into :webmock | ||
c.allow_http_connections_when_no_cassette = false | ||
|
||
[ | ||
'GITHUB_CLIENT_ID', | ||
'GITHUB_CLIENT_SECRET' | ||
].each do |env_var| | ||
c.filter_sensitive_data("<#{env_var}>") { ENV[env_var] } | ||
end | ||
end | ||
|
||
VCR.cucumber_tags do |t| | ||
t.tag '@vcr', use_scenario_name: true | ||
end |
139 changes: 139 additions & 0 deletions
139
features/support/vcr/Get_JSON/Get_JSON_for_a_dataset.yml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.