# HG changeset patch # User edogawaconan # Date 1396707632 -32400 # Node ID 325fcf388442a3dadc4fa48c0df83f46a381b6a0 # Parent 3c22d4acc2fae1ccfadc9a30885a1588cf4eca11 Another test for paste creation. diff -r 3c22d4acc2fa -r 325fcf388442 test/controllers/pastes_controller_test.rb --- a/test/controllers/pastes_controller_test.rb Sat Apr 05 23:08:49 2014 +0900 +++ b/test/controllers/pastes_controller_test.rb Sat Apr 05 23:20:32 2014 +0900 @@ -17,6 +17,14 @@ assert_response :redirect end + test "creates paste from base64 gzip" do + assert_difference("Paste.count", 1) do + post :create, "paste" => { "paste_gzip_base64" => Base64.encode64(ActiveSupport::Gzip.compress("here be paste")) } + end + + assert_response :redirect + end + test "filters spam" do assert_no_difference("Paste.count") do post :create, "url1" => "http://hello.com", "paste" => { "paste" => "here be paste", "key" => "12341234" }