Skip to content

Instantly share code, notes, and snippets.

@mikepack
Created February 12, 2012 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikepack/1810537 to your computer and use it in GitHub Desktop.
Save mikepack/1810537 to your computer and use it in GitHub Desktop.
interest_spec.rb
require 'services/user'
require 'services/artist'
describe 'POST /interests' do
# Use User and Artist Ruby wrappers to call services
let(:user) { Services::User.create(:name => 'Mike Pack') }
let(:artist) { Services::Artist.create(:name => 'Cool Band', :genres => ['Jazz', 'R&B']) }
it 'registers a users interest in an artist' do
# Initiate POST request
post '/interests', {
:user_id => user.id,
:artist_id => artist.id
}.to_json
last_response.should be_ok
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment