fix ticketing system error on bootstrap of new install
[freeside.git] / rt / t / web / clickjacking-preventions.t
1 use strict;
2 use warnings;
3
4 use RT::Test tests => 11;
5
6 my ($url, $m);
7
8 # Enabled by default
9 {
10     ok(RT->Config->Get('Framebusting'), "Framebusting enabled by default");
11
12     ($url, $m) = RT::Test->started_ok;
13     $m->get_ok($url);
14     $m->content_contains('if (window.top !== window.self) {', "Found the framekiller javascript");
15     is $m->response->header('X-Frame-Options'), 'DENY', "X-Frame-Options is set to DENY";
16
17     RT::Test->stop_server;
18 }
19
20 # Disabled
21 {
22     RT->Config->Set('Framebusting', 0);
23
24     ($url, $m) = RT::Test->started_ok;
25     $m->get_ok($url);
26     $m->content_lacks('if (window.top !== window.self) {', "Didn't find the framekiller javascript");
27     is $m->response->header('X-Frame-Options'), undef, "X-Frame-Options is not present";
28 }
29