diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 13:39:51 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-03-14 13:39:51 -0700 |
commit | b7b6c22d7807c7f587dcde90ea30f98f17278d1a (patch) | |
tree | cb94d5f2c7a8e5c83517c6b1481f7192057b14ff /actionpack/test | |
parent | 36f7732e820ce4d3c4a46bd0a1b15fd8902467b3 (diff) | |
parent | 2651b597f2491303e143aa063f3f231bf751c382 (diff) | |
download | rails-b7b6c22d7807c7f587dcde90ea30f98f17278d1a.tar.gz rails-b7b6c22d7807c7f587dcde90ea30f98f17278d1a.tar.bz2 rails-b7b6c22d7807c7f587dcde90ea30f98f17278d1a.zip |
Merge pull request #9713 from imanel/live_stale
Handle conditional get in live requests
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/live_stream_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/test/controller/live_stream_test.rb b/actionpack/test/controller/live_stream_test.rb index 3b1a07d7af..5755444a65 100644 --- a/actionpack/test/controller/live_stream_test.rb +++ b/actionpack/test/controller/live_stream_test.rb @@ -48,6 +48,10 @@ module ActionController end response.stream.close end + + def with_stale + render :text => 'stale' if stale?(:etag => "123") + end end tests TestController @@ -117,5 +121,16 @@ module ActionController assert_equal 'zomg', response.body assert response.stream.closed?, 'stream should be closed' end + + def test_stale_without_etag + get :with_stale + assert_equal 200, @response.status.to_i + end + + def test_stale_with_etag + @request.if_none_match = Digest::MD5.hexdigest("123") + get :with_stale + assert_equal 304, @response.status.to_i + end end end |