Skip to content

Commit

Permalink
[SeeSomething] Remove cobrand.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Mar 31, 2017
1 parent 3d967f0 commit ed850c6
Show file tree
Hide file tree
Showing 27 changed files with 2 additions and 811 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ FixMyBarangay.po
/web/css/main.css
/web/cobrands/*/*.css
/web/cobrands/*/*.css.map
/web/cobrands/seesomething
*.auto.min.js

# Photo upload cache
Expand Down
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/App/Controller/Admin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ sub stats : Path('stats') : Args(0) {
$selected_body = $c->user->from_body->id;
}

if ( $c->cobrand->moniker eq 'seesomething' || $c->cobrand->moniker eq 'zurich' ) {
if ( $c->cobrand->moniker eq 'zurich' ) {
return $c->cobrand->admin_stats();
}

Expand Down
135 changes: 0 additions & 135 deletions perllib/FixMyStreet/Cobrand/SeeSomething.pm

This file was deleted.

9 changes: 1 addition & 8 deletions perllib/FixMyStreet/SendReport/Email.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ sub build_recipient_list {
$self->unconfirmed_notes->{$body_email}{$row->category} = $note;
}

my $body_name = $body->name;
# see something uses council areas but doesn't send to councils so just use a
# generic name here to minimise confusion
if ( $row->cobrand eq 'seesomething' ) {
$body_name = 'See Something, Say Something';
}

my @emails;
# allow multiple emails per contact
if ( $body_email =~ /,/ ) {
Expand All @@ -44,7 +37,7 @@ sub build_recipient_list {
@emails = ( $body_email );
}
for my $email ( @emails ) {
push @{ $self->to }, [ $email, $body_name ];
push @{ $self->to }, [ $email, $body->name ];
}
}

Expand Down
115 changes: 0 additions & 115 deletions t/app/controller/report_new.t
Original file line number Diff line number Diff line change
Expand Up @@ -1363,121 +1363,6 @@ subtest "test Hart" => sub {
}
};

subtest "test SeeSomething" => sub {
$mech->host('seesomething.fixmystreet.com');
$mech->clear_emails_ok;
$mech->log_out_ok;

my $cobrand = FixMyStreet::Cobrand::SeeSomething->new();

my $body_ss = $mech->create_body_ok(2535, 'Sandwell Borough Council', id => 2535);
my $bus_contact = $mech->create_contact_ok(
body_id => $body_ss->id,
category => 'Bus',
email => '[email protected]',
non_public => 1,
);

for my $test ( {
desc => 'report with no user details works',
pc => 'WS1 4NH',
fields => {
detail => 'Test report details',
category => 'Bus',
subcategory => 'Smoking',
},
email => $cobrand->anonymous_account->{email},
},
{
desc => 'report with user details works',
pc => 'WS1 4NH',
fields => {
detail => 'Test report details',
category => 'Bus',
subcategory => 'Smoking',
email => '[email protected]',
name => 'Non Anon',
},
email => '[email protected]',
},
{
desc => 'report with public category',
pc => 'WS1 4NH',
fields => {
detail => 'Test report details',
category => 'Bus',
subcategory => 'Smoking',
},
email => $cobrand->anonymous_account->{email},
public => 1,
}
) {
subtest $test->{desc} => sub {
$mech->clear_emails_ok;
my $user =
FixMyStreet::App->model('DB::User')->find( { email => $test->{email} } );

if ( $user ) {
$user->alerts->delete;
$user->problems->delete;
$user->delete;
}

if ( $test->{public} ) {
$bus_contact->non_public(0);
$bus_contact->update;
} else {
$bus_contact->non_public(1);
$bus_contact->update;
}

$mech->get_ok( '/around' );
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'seesomething' ],
MAPIT_URL => 'http://mapit.uk/',
}, sub {
$mech->submit_form_ok(
{
with_fields => {
pc => $test->{pc},
},
},
'submit around form',
);
$mech->follow_link_ok( { text_regex => qr/skip this step/i, }, "follow 'skip this step' link" );

$mech->submit_form_ok(
{
with_fields => $test->{fields},
},
'Submit form details with no user details',
);
};
is_deeply $mech->page_errors, [], "check there were no errors";

$user =
FixMyStreet::App->model('DB::User')->find( { email => $test->{email} } );
ok $user, "user found";

my $report = $user->problems->first;
ok $report, "Found the report";

$mech->email_count_is(0);

ok $report->confirmed, 'Report is confirmed automatically';

is $mech->uri->path, '/report/new', 'stays on report/new page';
$mech->content_contains( 'Your report has been sent', 'use report created template' );

$user->alerts->delete;
$user->problems->delete;
$user->delete;
};
}

$bus_contact->delete;
};

subtest "categories from deleted bodies shouldn't be visible for new reports" => sub {
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ { fixmystreet => '.' } ],
Expand Down
87 changes: 0 additions & 87 deletions t/cobrand/seesomething.t

This file was deleted.

7 changes: 0 additions & 7 deletions templates/web/seesomething/admin/footer.html

This file was deleted.

2 changes: 0 additions & 2 deletions templates/web/seesomething/admin/header.html

This file was deleted.

Loading

0 comments on commit ed850c6

Please sign in to comment.