Skip to content

Instantly share code, notes, and snippets.

@karmi
Created February 24, 2010 11:26
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 karmi/313341 to your computer and use it in GitHub Desktop.
Save karmi/313341 to your computer and use it in GitHub Desktop.
diff --git a/test/filter_test.rb b/test/filter_test.rb
index b4bbda1..bd1daeb 100644
--- a/test/filter_test.rb
+++ b/test/filter_test.rb
@@ -181,6 +181,16 @@ class AfterFilterTest < Test::Unit::TestCase
assert_equal 'cool', body
end
+ it "does modify the response body" do
+ mock_app {
+ get('/foo') { 'cool' }
+ after { response.body = 'uncool' }
+ }
+ get '/foo'
+ assert ok?
+ assert_equal 'uncool', body
+ end
+
it "does modify the response with halt" do
mock_app {
get '/foo' do
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment