Skip to content

Instantly share code, notes, and snippets.

@marciok
Last active December 12, 2015 03:38
Show Gist options
  • Save marciok/4707924 to your computer and use it in GitHub Desktop.
Save marciok/4707924 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe 'v1/endpoints/index', formats: [ :json ] do
let(:endpoint) { 'http://battle-server-mock.herokuapp.com/1' }
describe 'Endpoints API Representation' do
before { render }
let(:json) { ActiveSupport::JSON.decode(rendered) }
subject { json }
it { should include('url') }
describe 'url' do
subject { json['url'] }
it { should eql(endpoint) }
end
end
end
# Failure/Error: it { should eql(endpoint) }
# expected: "http://battle-server-mock.herokuapp.com/1"
# got: nil
# (compared using eql?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment