Last active
August 29, 2015 14:00
-
-
Save slowjud/7f5fed6bd4b4180c9a6a to your computer and use it in GitHub Desktop.
Testing apis
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
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 |
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
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