Skip to content

Instantly share code, notes, and snippets.

@slowjud
Last active August 29, 2015 14:00
Show Gist options
  • Save slowjud/7f5fed6bd4b4180c9a6a to your computer and use it in GitHub Desktop.
Save slowjud/7f5fed6bd4b4180c9a6a to your computer and use it in GitHub Desktop.
Testing apis
require 'simplecov'
SimpleCov.start 'rails' do
add_filter 'app/controllers/[\w_]*.rb'
add_filter 'app/models/[\w_]*.rb'
add_filter 'app/modules/[\w_]*.rb'
end
SimpleCov.minimum_coverage 100
require 'spec_helper'
describe Api::V1, :type => :feature do
let(:params) { {postcode: '2000'} }
before :all do
#setup the objects here
end
before :each do
Capybara.current_session.driver.header 'Accept', 'application/vnd.betterbills.v1'
end
context 'All' do
it 'should produce some json with all sqs' do
visit api_v1_index_url(params)
expect(page.body).to have_json_type(Array).at_path('all_the_things')
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment