diff options
author | Azul <azul@riseup.net> | 2017-03-20 11:00:28 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2017-03-20 11:04:44 +0100 |
commit | 32b07d8c98719f3c52a3c5315da1f61c6e35cbd6 (patch) | |
tree | ce9e94b23dc6b838a9e68a96b1d7cc811924f952 /test/integration | |
parent | d7990f1b2af378ad071db6d94c5f95a50d6b7dcd (diff) |
test: 404 response for missing key
enable testing error responses on the full rack stack.
Diffstat (limited to 'test/integration')
-rw-r--r-- | test/integration/key_discovery_test.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/key_discovery_test.rb b/test/integration/key_discovery_test.rb new file mode 100644 index 0000000..2a38a78 --- /dev/null +++ b/test/integration/key_discovery_test.rb @@ -0,0 +1,23 @@ +require 'test_helper' + +# This is not really a browser test - key discovery is used from bitmask. +# However we need to make sure to test the full rack stack to replicate +# exception handling. +class KeyDiscoveryTest < RackStackTest + include Capybara::DSL + + setup do + # make sure we test the whole stack... + Capybara.current_driver = Capybara.javascript_driver + end + + teardown do + # Revert Capybara.current_driver to Capybara.default_driver + Capybara.use_default_driver + end + + def test_404_on_non_existing_user + visit '/key/asjkholifweatg' + assert_equal 404, status_code + end +end |