aboutsummaryrefslogtreecommitdiff
path: root/test/tc_mauve_web_interface.rb
diff options
context:
space:
mode:
authorTelyn <telyn@telynz.uk>2018-01-31 11:30:50 +0000
committerGitHub <noreply@github.com>2018-01-31 11:30:50 +0000
commit9ef70ed3d53e11dacc5d4df4478d5ff452a2dd6d (patch)
treeace44f0ea0a81d7d369df74c3d95c219905e7fa6 /test/tc_mauve_web_interface.rb
parent0be1fa0ebadf9435a760582d17f47ff96dc0851c (diff)
parent9af0d1761552601db30de7a991d90d64ec6c88f5 (diff)
Merge pull request #6 from BytemarkHosting/release-to-masterHEADmaster
Release to master
Diffstat (limited to 'test/tc_mauve_web_interface.rb')
-rw-r--r--test/tc_mauve_web_interface.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/tc_mauve_web_interface.rb b/test/tc_mauve_web_interface.rb
index 54c9697..c93c25c 100644
--- a/test/tc_mauve_web_interface.rb
+++ b/test/tc_mauve_web_interface.rb
@@ -112,13 +112,21 @@ EOF
assert last_response.body.include?("Mauve: Login")
assert session['__FLASH__'].empty?
- # Check we can access this page before logging in.
+ # Check we can't access this page before logging in.
get '/alerts'
assert(session['__FLASH__'].has_key?(:error),"The flash error wasn't set following forbidden access")
follow_redirect! while last_response.redirect?
assert_equal(403, last_response.status, "The HTTP status wasn't 403")
assert last_response.body.include?("Mauve: Login")
assert session['__FLASH__'].empty?
+
+ # Check we can't access AJAX requests before logging in.
+ get '/ajax/alerts_table/raised/subject', {}, {:xhr => true}
+ refute(session['__FLASH__'].has_key?(:error), "The flash error shouldn't have been set from an AJAX call")
+ follow_redirect! while last_response.redirect?
+ assert_equal(403, last_response.status, "The HTTP status wasn't 403")
+ assert last_response.body.include?('You must be logged in to access this page')
+ assert session['__FLASH__'].empty?
#
# Try to falsify our login.