Skip to content

Instantly share code, notes, and snippets.

@besquared
Created June 25, 2009 20:09
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 besquared/136128 to your computer and use it in GitHub Desktop.
Save besquared/136128 to your computer and use it in GitHub Desktop.
event_msg = Protopuffs::Message::Event.new(:id => "4e09c87fc4d4468783d4a42a8ed72969",
:user_id => user_id,
:created_at => Time.now.utc.to_i)
response_body = event_msg.to_wire_format
content_length = response_body.length
response_code = '201 Created'
event_response = ERB.new(File.read(Rails.root.join("features/step_definitions/response_templates/response.erb")), nil, '-').result(binding)
FakeWeb.register_uri(:post, "http://api.rupture.com/events", :response => event_response)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment