comparison test/controllers/pastes_controller_test.rb @ 315:325fcf388442

Another test for paste creation.
author edogawaconan <me@myconan.net>
date Sat, 05 Apr 2014 23:20:32 +0900
parents 3c22d4acc2fa
children 9fc6b919369c
comparison
equal deleted inserted replaced
314:3c22d4acc2fa 315:325fcf388442
15 end 15 end
16 16
17 assert_response :redirect 17 assert_response :redirect
18 end 18 end
19 19
20 test "creates paste from base64 gzip" do
21 assert_difference("Paste.count", 1) do
22 post :create, "paste" => { "paste_gzip_base64" => Base64.encode64(ActiveSupport::Gzip.compress("here be paste")) }
23 end
24
25 assert_response :redirect
26 end
27
20 test "filters spam" do 28 test "filters spam" do
21 assert_no_difference("Paste.count") do 29 assert_no_difference("Paste.count") do
22 post :create, "url1" => "http://hello.com", "paste" => { "paste" => "here be paste", "key" => "12341234" } 30 post :create, "url1" => "http://hello.com", "paste" => { "paste" => "here be paste", "key" => "12341234" }
23 end 31 end
24 32