aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-11-08 16:57:51 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-11-08 16:57:51 +0000
commitcc7cb6ca9eb2c6035fe439607a61986a723f3768 (patch)
treed3ba2a080292b5d43d88d48d431a2c39fb8ab750 /t/cobrand
parentbaf1622fa8e118dcda25c2ad9aea4d4e784003be (diff)
parent82459ee35e99b25983cf934531142634311f260f (diff)
Merge branch '1890-fixmystreet.com-facebook-login'
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/councils.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/t/cobrand/councils.t b/t/cobrand/councils.t
index 4de8bbf2e..c44605bd9 100644
--- a/t/cobrand/councils.t
+++ b/t/cobrand/councils.t
@@ -1,6 +1,15 @@
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
+my $oxon = $mech->create_body_ok(2237, 'Oxfordshire County Council' );
+my $contact = $mech->create_contact_ok( body_id => $oxon->id, category => 'Cows', email => 'cows@example.net' );
+
+my ($report) = $mech->create_problems_for_body(1, $oxon->id, 'Test', {
+ category => 'Cows', cobrand => 'fixmystreet',
+});
+my $report_id = $report->id;
+
+
foreach my $council (qw/oxfordshire bromley/) {
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ $council ],
@@ -11,4 +20,31 @@ foreach my $council (qw/oxfordshire bromley/) {
};
}
+
+foreach my $test (
+ { cobrand => 'fixmystreet', social => 1 },
+ { cobrand => 'bromley', social => 0 },
+) {
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ $test->{cobrand} ],
+ FACEBOOK_APP_ID => 'facebook-app-id',
+ TWITTER_KEY => 'twitter-key',
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok('/auth');
+ $mech->contains_or_lacks($test->{social}, "Log in with Facebook");
+ $mech->contains_or_lacks($test->{social}, "Log in with Twitter");
+
+ $mech->get_ok("/report/new?lat=51.754926&lon=-1.256179");
+ $mech->contains_or_lacks($test->{social}, "Log in with Facebook");
+ $mech->contains_or_lacks($test->{social}, "Log in with Twitter");
+
+ $mech->get_ok("/report/$report_id");
+ $mech->contains_or_lacks($test->{social}, "Log in with Facebook");
+ $mech->contains_or_lacks($test->{social}, "Log in with Twitter");
+ };
+};
+
+
done_testing();