aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2014-07-29 18:11:34 +0100
committerMatthew Somerville <matthew@mysociety.org>2014-07-29 22:32:32 +0100
commit751fdd61a61c1b1e2e2c76249fe67f8aab112eb0 (patch)
tree24688e495546a9dcfa1dd768f89d0b0b6d4d2d9e /t/app
parentc9500b5dc75640e5b17a9a0fb99e0ed19b738e13 (diff)
Removal old Southampton/Reading/Lichfield cobrands.
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/report_new.t36
-rw-r--r--t/app/controller/rss.t28
-rw-r--r--t/app/model/alert_type.t8
-rw-r--r--t/app/model/problem.t30
4 files changed, 51 insertions, 51 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index 10b8c5869..79072bcfe 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -44,8 +44,8 @@ for my $body (
{ id => 2226, name => 'Gloucestershire County Council' },
{ id => 2326, name => 'Cheltenham Borough Council' },
{ id => 2482, name => 'Bromley Council' },
- { id => 2240, name => 'Staffordshire County Council' },
- { id => 2434, name => 'Lichfield District Council' },
+ { id => 2227, name => 'Hampshire County Council' },
+ { id => 2333, name => 'Hart Council' },
{ id => 2504, name => 'Westminster City Council' },
) {
$mech->create_body_ok($body->{id}, $body->{name});
@@ -87,13 +87,13 @@ my $contact5 = FixMyStreet::App->model('DB::Contact')->find_or_create( {
} );
my $contact6 = FixMyStreet::App->model('DB::Contact')->find_or_create( {
%contact_params,
- body_id => 2434, # Lichfield
+ body_id => 2333, # Hart
category => 'Trees',
email => 'trees@example.com',
} );
my $contact7 = FixMyStreet::App->model('DB::Contact')->find_or_create( {
%contact_params,
- body_id => 2240, # Lichfield
+ body_id => 2227, # Hampshire
category => 'Street lighting',
email => 'highways@example.com',
} );
@@ -1204,53 +1204,53 @@ subtest 'user title not reset if no user title in submission' => sub {
is $user->title, 'MR', 'User title unchanged';
};
-subtest "test Lichfield" => sub {
+subtest "test Hart" => sub {
for my $test (
{
desc => 'confirm link for cobrand council in two tier cobrand links to cobrand site',
category => 'Trees',
- council => 2434,
+ council => 2333,
national => 0,
button => 'submit_register',
},
{
desc => 'confirm link for non cobrand council in two tier cobrand links to national site',
category => 'Street Lighting',
- council => 2240,
+ council => 2227,
national => 1,
button => 'submit_register',
},
{
desc => 'confirm redirect for cobrand council in two tier cobrand redirects to cobrand site',
category => 'Trees',
- council => 2434,
+ council => 2333,
national => 0,
redirect => 1,
},
{
desc => 'confirm redirect for non cobrand council in two tier cobrand redirect to national site',
category => 'Street Lighting',
- council => 2240,
+ council => 2227,
national => 1,
redirect => 1,
},
) {
subtest $test->{ desc } => sub {
my $test_email = 'test-22@example.com';
- $mech->host( 'lichfielddc.fixmystreet.com' );
+ $mech->host( 'hart.fixmystreet.com' );
$mech->clear_emails_ok;
$mech->log_out_ok;
my $user = $mech->log_in_ok($test_email) if $test->{redirect};
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'lichfielddc', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'hart', 'fixmystreet' ],
BASE_URL => 'http://www.fixmystreet.com',
MAPIT_URL => 'http://mapit.mysociety.org/',
}, sub {
$mech->get_ok('/around');
- $mech->content_contains( "Lichfield District Council FixMyStreet" );
- $mech->submit_form_ok( { with_fields => { pc => 'WS13 7RD' } }, "submit location" );
+ $mech->content_contains( "Hart Council" );
+ $mech->submit_form_ok( { with_fields => { pc => 'GU51 4AE' } }, "submit location" );
$mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" );
my %optional_fields = $test->{redirect} ? () :
( email => $test_email, phone => '07903 123 456' );
@@ -1292,7 +1292,7 @@ subtest "test Lichfield" => sub {
if ( $test->{redirect} ) {
is $mech->uri->path, "/report/" . $report->id, "redirected to report page";
my $base = 'www.fixmystreet.com';
- $base = "lichfielddc.fixmystreet.com" unless $test->{national};
+ $base = "hart.fixmystreet.com" unless $test->{national};
is $mech->uri->host, $base, 'redirected to correct site';
} else {
# receive token
@@ -1305,21 +1305,21 @@ subtest "test Lichfield" => sub {
# confirm token
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'lichfielddc', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'hart', 'fixmystreet' ],
BASE_URL => 'http://www.fixmystreet.com',
}, sub {
$mech->get_ok($url);
};
my $base = 'www.fixmystreet.com';
- $base = 'lichfielddc.fixmystreet.com' unless $test->{national};
+ $base = 'hart.fixmystreet.com' unless $test->{national};
$mech->content_contains( $base . '/report/' .
$report->id, 'confirm page links to correct site' );
if ( $test->{national} ) {
# Shouldn't be found, as it was a county problem
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'lichfielddc', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'hart', 'fixmystreet' ],
}, sub {
is $mech->get( '/report/' . $report->id )->code, 404, "report not found";
};
@@ -1328,7 +1328,7 @@ subtest "test Lichfield" => sub {
$mech->host( 'www.fixmystreet.com' );
}
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'lichfielddc', 'fixmystreet' ],
+ ALLOWED_COBRANDS => [ 'hart', 'fixmystreet' ],
}, sub {
$mech->get_ok( '/report/' . $report->id );
};
diff --git a/t/app/controller/rss.t b/t/app/controller/rss.t
index bafa1ddc0..ae1c0d193 100644
--- a/t/app/controller/rss.t
+++ b/t/app/controller/rss.t
@@ -130,9 +130,9 @@ $report->delete();
my $now = DateTime->now();
my $report_to_council = FixMyStreet::App->model('DB::Problem')->find_or_create(
{
- postcode => 'WS13 6YY',
- bodies_str => '2434',
- areas => ',2434,2240,',
+ postcode => 'GU51 4AE',
+ bodies_str => '2333',
+ areas => ',2333,2227,',
category => 'Other',
title => 'council report',
detail => 'Test 2 Detail',
@@ -146,17 +146,17 @@ my $report_to_council = FixMyStreet::App->model('DB::Problem')->find_or_create(
cobrand => 'default',
cobrand_data => '',
send_questionnaire => 't',
- latitude => '52.727588',
- longitude => '-1.731322',
+ latitude => '51.279616',
+ longitude => '-0.846040',
user_id => $user1->id,
}
);
my $report_to_county_council = FixMyStreet::App->model('DB::Problem')->find_or_create(
{
- postcode => 'WS13 6YY',
- bodies_str => '2240',
- areas => ',2434,2240,',
+ postcode => 'GU51 4AE',
+ bodies_str => '2227',
+ areas => ',2333,2227,',
category => 'Other',
title => 'county report',
detail => 'Test 2 Detail',
@@ -170,23 +170,23 @@ my $report_to_county_council = FixMyStreet::App->model('DB::Problem')->find_or_c
cobrand => 'default',
cobrand_data => '',
send_questionnaire => 't',
- latitude => '52.727588',
- longitude => '-1.731322',
+ latitude => '51.279616',
+ longitude => '-0.846040',
user_id => $user1->id,
}
);
subtest "check RSS feeds on cobrand have correct URLs for non-cobrand reports" => sub {
- $mech->host('lichfielddc.fixmystreet.com');
+ $mech->host('hart.fixmystreet.com');
my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id;
my $expected2;
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ 'lichfielddc' ],
+ ALLOWED_COBRANDS => [ 'hart' ],
MAPIT_URL => 'http://mapit.mysociety.org/',
}, sub {
- $mech->get_ok("/rss/area/Lichfield");
- my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('lichfielddc')->new();
+ $mech->get_ok("/rss/area/Hart");
+ my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('hart')->new();
$expected2 = $cobrand->base_url . '/report/' . $report_to_council->id;
};
diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t
index ae413978f..5b7494a04 100644
--- a/t/app/model/alert_type.t
+++ b/t/app/model/alert_type.t
@@ -348,7 +348,7 @@ my $ward_alert = FixMyStreet::App->model('DB::Alert')->find_or_create(
alert_type => 'area_problems',
whensubscribed => $dt->ymd . ' ' . $dt->hms,
confirmed => 1,
- cobrand => 'lichfielddc',
+ cobrand => 'hart',
}
);
@@ -444,7 +444,7 @@ subtest "check alerts from cobrand send main site url for alerts for different c
my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id;
my $expected3 = mySociety::Config::get('BASE_URL') . '/report/' . $report_outside_district->id;
- my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('lichfielddc')->new();
+ my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('hart')->new();
my $expected2 = $cobrand->base_url . '/report/' . $report_to_council->id;
like $body, qr#$expected1#, 'non cobrand area report point to fixmystreet.com';
@@ -460,7 +460,7 @@ my $local_alert = FixMyStreet::App->model('DB::Alert')->find_or_create(
parameter2 => 52.727588,
alert_type => 'local_problems',
whensubscribed => $dt->ymd . ' ' . $dt->hms,
- cobrand => 'lichfielddc',
+ cobrand => 'hart',
confirmed => 1,
}
);
@@ -480,7 +480,7 @@ subtest "check local alerts from cobrand send main site url for alerts for diffe
my $body = $email->body;
my $expected1 = mySociety::Config::get('BASE_URL') . '/report/' . $report_to_county_council->id;
- my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('lichfielddc')->new();
+ my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('hart')->new();
my $expected2 = $cobrand->base_url . '/report/' . $report_to_council->id;
like $body, qr#$expected1#, 'non cobrand area report point to fixmystreet.com';
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index f15d56bfe..96c2771da 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -381,8 +381,8 @@ for my $body (
{ id => 2651, name => 'City of Edinburgh Council' },
{ id => 2226, name => 'Gloucestershire County Council' },
{ id => 2326, name => 'Cheltenham Borough Council' },
- { id => 2434, name => 'Lichfield District Council' },
- { id => 2240, name => 'Staffordshire County Council' },
+ { id => 2333, name => 'Hart Council' },
+ { id => 2227, name => 'Hampshire County Council' },
{ id => 14279, name => 'Ballymoney Borough Council' },
{ id => 2636, name => 'Isle of Wight Council' },
{ id => 2649, name => 'Fife Council' },
@@ -405,11 +405,11 @@ for my $contact ( {
category => 'potholes',
email => '2326@example.org',
}, {
- body_id => 2434, # Lichfield
+ body_id => 2333, # Hart
category => 'potholes',
email => 'trees@example.com',
}, {
- body_id => 2240, # Staffordshire
+ body_id => 2227, # Hampshire
category => 'potholes',
email => 'highways@example.com',
}, {
@@ -472,20 +472,20 @@ foreach my $test ( {
desc => 'email to two tier council that only shows district, district',
unset_whendef => 1,
email_count => 1,
- to => qr'Lichfield District Council',
- dear => qr'Dear Lichfield District Council,',
- body => '2434',
- cobrand => 'lichfielddc',
- url => 'lichfielddc.',
+ to => qr'Hart Council',
+ dear => qr'Dear Hart Council,',
+ body => '2333',
+ cobrand => 'hart',
+ url => 'hart.',
}, {
%common,
desc => 'email to two tier council that only shows district, county',
unset_whendef => 1,
email_count => 1,
- to => qr'Staffordshire County Council" <highways@example',
- dear => qr'Dear Staffordshire County Council,',
- body => '2240',
- cobrand => 'lichfielddc',
+ to => qr'Hampshire County Council" <highways@example',
+ dear => qr'Dear Hampshire County Council,',
+ body => '2227',
+ cobrand => 'hart',
url => 'www.',
}, {
%common,
@@ -520,8 +520,8 @@ foreach my $test ( {
BASE_URL => 'http://www.fixmystreet.com',
MAPIT_URL => 'http://mapit.mysociety.org/',
};
- if ( $test->{cobrand} && $test->{cobrand} =~ /lichfielddc/ ) {
- $override->{ALLOWED_COBRANDS} = [ 'lichfielddc' ];
+ if ( $test->{cobrand} && $test->{cobrand} =~ /hart/ ) {
+ $override->{ALLOWED_COBRANDS} = [ 'hart' ];
}
$mech->clear_emails_ok;