Last active
July 15, 2016 16:53
-
-
Save orangeeli/eaef05b23095d1c8fc7bc6b97d9ccb07 to your computer and use it in GitHub Desktop.
A spec example with Factory Girl
This file contains hidden or 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 'rails_helper' | |
RSpec.describe 'GET /api/v1/gorilla' do | |
let(:gorilla) {FactoryGirl.create(:gorilla)} | |
before { get '/api/v1/gorilla'} | |
subject { response } | |
it 'should be successful' do | |
expect(response.status).to eq 200 | |
end | |
its(:body) { should match_schema 'gorillas' } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment