Skip to content

Instantly share code, notes, and snippets.

@orangeeli
Last active July 15, 2016 16:53
Show Gist options
  • Save orangeeli/eaef05b23095d1c8fc7bc6b97d9ccb07 to your computer and use it in GitHub Desktop.
Save orangeeli/eaef05b23095d1c8fc7bc6b97d9ccb07 to your computer and use it in GitHub Desktop.
A spec example with Factory Girl
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