Skip to content

Instantly share code, notes, and snippets.

@fearoffish
Created December 19, 2012 20:00
Show Gist options
  • Save fearoffish/4339963 to your computer and use it in GitHub Desktop.
Save fearoffish/4339963 to your computer and use it in GitHub Desktop.
rubymotion spec
describe "#get" do
it "adds an auth token to the params when given" do
stub_request(:get, "http://fcp.dev/api/?auth_token=token").
to_return(body: "{\"Hello\":\"World\"}", content_type: "application/json")
@body = nil
@server.auth_token = 'token'
@server.get('http://fcp.dev/api/') do |body|
@body = body
resume
end
wait_max 1.0 do
@body.should.be == {"Hello" => "World"}
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment