aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-30 16:56:12 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-30 16:56:12 +0100
commit0e6bb3e802c0614d64366bd19732b37a574dc12c (patch)
tree01b5d111754a0acef3f8a71da526ce1fbe59de55 /t
parentb756440e4b5c0b356ee0d65d1647124317535c95 (diff)
parentfb78afe61194ea9b6fbec9596d69627e315ab97f (diff)
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into new_statuses
Conflicts: perllib/FixMyStreet/App/Controller/Reports.pm
Diffstat (limited to 't')
-rw-r--r--t/00-check-we-are-staging.t24
-rw-r--r--t/app/controller/around.t25
-rw-r--r--t/app/controller/auth.t8
3 files changed, 27 insertions, 30 deletions
diff --git a/t/00-check-we-are-staging.t b/t/00-check-we-are-staging.t
new file mode 100644
index 000000000..a1da68798
--- /dev/null
+++ b/t/00-check-we-are-staging.t
@@ -0,0 +1,24 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use FixMyStreet;
+
+# check that all the fields listed in general-example are also present in
+# general - helps prevent later test failures due to un-noticed additions to the
+# config file.
+
+# This code will bail_out to prevent the test suite proceeding to save time if
+# issues are found.
+
+# load the config file and store the contents in a readonly hash
+
+mySociety::Config::set_file( FixMyStreet->path_to("conf/general") );
+
+BAIL_OUT( "Test suite modifies databases so should not be run on live servers" )
+ unless mySociety::Config::get('STAGING_SITE', undef);
+
+ok mySociety::Config::get('STAGING_SITE', undef), 'staging server';
+
+done_testing();
diff --git a/t/app/controller/around.t b/t/app/controller/around.t
index ba0dfe1b4..0060e957c 100644
--- a/t/app/controller/around.t
+++ b/t/app/controller/around.t
@@ -41,21 +41,6 @@ foreach my $test (
pc_alternatives => [],
},
{
- pc => 'glenthorpe',
- errors => [],
- pc_alternatives => [
- 'Glenthorpe Crescent, Leeds LS9 7',
- 'Glenthorpe Rd, Merton, Greater London SM4 4',
- 'Glenthorpe Ave, Leeds LS9 7',
- 'Glenthorne Rd, Hammersmith, Greater London W6 0',
- 'Glenthorne Ave, Yeovil, Somerset BA21 4',
- 'Glenthorne Rd, Kenwyn, Cornwall TR3 6',
- 'Glenthorne Dr, Cheslyn Hay, Staffordshire WS6 7',
- 'Glenthorne Gardens, Ilford, Greater London IG5 0',
- 'Glenthorne Ave, Croydon, Greater London CR0 7',
- ],
- },
- {
pc => 'Glenthorpe Ct, Katy, TX 77494, USA',
errors =>
['Sorry, we could not find that location.'],
@@ -81,16 +66,6 @@ foreach my $test (
latitude => '51.50101',
longitude => '-0.141587',
},
- {
- pc => 'Manchester',
- latitude => '53.480713',
- longitude => '-2.234376',
- },
- {
- pc => 'Glenthorpe Rd, Merton, Greater London SM4 4, UK',
- latitude => '51.3938',
- longitude => '-0.22096',
- },
)
{
subtest "check lat/lng for '$test->{pc}'" => sub {
diff --git a/t/app/controller/auth.t b/t/app/controller/auth.t
index 1a16457f9..fef45ac90 100644
--- a/t/app/controller/auth.t
+++ b/t/app/controller/auth.t
@@ -197,12 +197,10 @@ foreach my $remember_me ( '1', '0' ) {
);
is $mech->uri->path, '/my', "redirected to correct page";
- # check that the cookie has no expiry set
my $expiry = $mech->session_cookie_expiry;
- is( $expiry, 0, "no expiry time" );
- #$remember_me
- # ? cmp_ok( $expiry, '>', 86400, "long expiry time" )
- # : is( $expiry, 0, "no expiry time" );
+ $remember_me
+ ? cmp_ok( $expiry, '>', 86400, "long expiry time" )
+ : is( $expiry, 0, "no expiry time" );
# logout
$mech->log_out_ok;