Skip to content

Instantly share code, notes, and snippets.

@leshill
Created July 17, 2010 01:54
Show Gist options
  • Save leshill/479163 to your computer and use it in GitHub Desktop.
Save leshill/479163 to your computer and use it in GitHub Desktop.
# place in features/support
require 'ephemeral_response'
EphemeralResponse.configure do |config|
config.expiration = lambda { one_day * 30 }
config.white_list = ['localhost', '127.0.0.1']
config.register('api.twitter.com') do |request|
if oauth_token_match = request['authorization'].match(/oauth_token=\"\d+-\w+"/)
"#{request.uri.to_s}#{request.method}#{oauth_token_match[0]}"
else
"#{request.uri.to_s}#{request.method}#{request.body}"
end
end
end
Before do
EphemeralResponse.activate
end
After do
EphemeralResponse.deactivate
end
@sandro
Copy link

sandro commented Jul 17, 2010

very cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment