Skip to content

Commit

Permalink
Merge 8b23654 into efcae9c
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Pikesley committed Jan 3, 2016
2 parents efcae9c + 8b23654 commit 90ca090
Show file tree
Hide file tree
Showing 18 changed files with 1,231 additions and 39 deletions.
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
* Check for cache expiry (timecop!)
* Give things an expiry, change colour / move them up the list when they're due
* Individual URLs per dataset, maybe iframe the dashboards ala Sir Handel
* Front page with high-priority things?
Expand Down
4 changes: 3 additions & 1 deletion config/lookups.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
catface:
url: /catface
title: Catface
repo: pikesley/catface

snake-data:
snake:
url: /snake
title: Snake
repo: pikesley/snake-data

datasets:
length:
Expand Down
1 change: 0 additions & 1 deletion features/catface.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ Feature: Get Catface data
When I send a GET request to "/catface"
Then the response status should be "200"
And the XML response should have "//title" with the text "Catface"
And the XML response should have "//div[@id = 'numbers']"
16 changes: 16 additions & 0 deletions features/json.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@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"

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"
7 changes: 7 additions & 0 deletions features/step_definitions/dashboard_steps.rb
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
20 changes: 20 additions & 0 deletions features/support/vcr.rb
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 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.

0 comments on commit 90ca090

Please sign in to comment.