summaryrefslogtreecommitdiff
path: root/test/functional/keys_controller_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2017-03-21 09:37:29 +0000
committerazul <azul@riseup.net>2017-03-21 09:37:29 +0000
commit987d1bf7c87f7ea3d17c40015b2ec92a8a0b4ecc (patch)
treef2eae1401adccf77cb244d0b642f7ee66f3d1a46 /test/functional/keys_controller_test.rb
parent3fd52ccca46310c32ecfabb69b41630cb41dca7e (diff)
parent47c945b101a01bf438024ede594b3a039c4eca66 (diff)
Merge branch 'bugfix/404-for-keys-on-text-request' into 'master'
fix: 404 on key request with non html content-type Closes #8 See merge request !20
Diffstat (limited to 'test/functional/keys_controller_test.rb')
-rw-r--r--test/functional/keys_controller_test.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/functional/keys_controller_test.rb b/test/functional/keys_controller_test.rb
index f5e2691..1d437e7 100644
--- a/test/functional/keys_controller_test.rb
+++ b/test/functional/keys_controller_test.rb
@@ -3,7 +3,10 @@ require 'test_helper'
class KeysControllerTest < ActionController::TestCase
test "get key for username with dot" do
- assert_recognizes({controller: 'keys', action: 'show', login: 'username.with.dot'}, 'key/username.with.dot')
+ assert_routing 'key/username.with.dot', controller: 'keys',
+ action: 'show',
+ login: 'username.with.dot',
+ format: :text
end
test "get existing public key" do
@@ -27,10 +30,9 @@ class KeysControllerTest < ActionController::TestCase
end
test "get public key for non-existing user" do
- # raise 404 error if user doesn't exist (doesn't need to be this routing error, but seems fine to assume for now):
- assert_raise(ActionController::RoutingError) {
- get :show, :login => 'asdkljslksjfdlskfj'
- }
+ # raise 404 error if user doesn't exist
+ get :show, :login => 'asdkljslksjfdlskfj'
+ assert_response :not_found
end
end