Mercurial > zeropaste
view test/controllers/pastes_controller_test.rb @ 380:2ddd61aca2c8
I18n. And refactor paste privacy settings form.
author | nanaya <me@myconan.net> |
---|---|
date | Sun, 07 Jun 2015 02:45:49 +0900 |
parents | 325fcf388442 |
children | 9fc6b919369c |
line wrap: on
line source
require "test_helper" class PastesControllerTest < ActionController::TestCase test "creates paste from plaintext" do assert_difference("Paste.count", 1) do post :create, "paste" => { "paste" => "here be paste" } end assert_response :redirect end test "creates paste from gzip" do assert_difference("Paste.count", 1) do post :create, "paste" => { "paste_gzip" => ActiveSupport::Gzip.compress("here be paste") } end 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" } end assert_response :success end end