aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin.t
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller/admin.t')
-rw-r--r--t/app/controller/admin.t18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index d50702086..b170633fc 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -25,7 +25,7 @@ my $dt = DateTime->new(
second => 23
);
-my $report = FixMyStreet::App->model('DB::Problem')->find_or_create(
+my $report = FixMyStreet::DB->resultset('Problem')->find_or_create(
{
postcode => 'SW1A 1AA',
bodies_str => '2504',
@@ -53,7 +53,7 @@ my $report = FixMyStreet::App->model('DB::Problem')->find_or_create(
my $report_id = $report->id;
ok $report, "created test report - $report_id";
-my $alert = FixMyStreet::App->model('DB::Alert')->find_or_create(
+my $alert = FixMyStreet::DB->resultset('Alert')->find_or_create(
{
alert_type => 'area_problems',
parameter => 2482,
@@ -65,20 +65,20 @@ my $alert = FixMyStreet::App->model('DB::Alert')->find_or_create(
$mech->log_in_ok( $superuser->email );
subtest 'check summary counts' => sub {
- my $problems = FixMyStreet::App->model('DB::Problem')->search( { state => { -in => [qw/confirmed fixed closed investigating planned/, 'in progress', 'fixed - user', 'fixed - council'] } } );
+ my $problems = FixMyStreet::DB->resultset('Problem')->search( { state => { -in => [qw/confirmed fixed closed investigating planned/, 'in progress', 'fixed - user', 'fixed - council'] } } );
ok $mech->host('www.fixmystreet.com');
my $problem_count = $problems->count;
$problems->update( { cobrand => '' } );
- FixMyStreet::App->model('DB::Problem')->search( { bodies_str => 2489 } )->update( { bodies_str => 1 } );
+ FixMyStreet::DB->resultset('Problem')->search( { bodies_str => 2489 } )->update( { bodies_str => 1 } );
- my $q = FixMyStreet::App->model('DB::Questionnaire')->find_or_new( { problem => $report, });
+ my $q = FixMyStreet::DB->resultset('Questionnaire')->find_or_new( { problem => $report, });
$q->whensent( \'current_timestamp' );
$q->in_storage ? $q->update : $q->insert;
- my $alerts = FixMyStreet::App->model('DB::Alert')->search( { confirmed => { '>' => 0 } } );
+ my $alerts = FixMyStreet::DB->resultset('Alert')->search( { confirmed => { '>' => 0 } } );
my $a_count = $alerts->count;
FixMyStreet::override_config {
@@ -92,7 +92,7 @@ subtest 'check summary counts' => sub {
$mech->content_contains( "$problem_count</strong> live problems" );
$mech->content_contains( "$a_count confirmed alerts" );
- my $questionnaires = FixMyStreet::App->model('DB::Questionnaire')->search( { whensent => { -not => undef } } );
+ my $questionnaires = FixMyStreet::DB->resultset('Questionnaire')->search( { whensent => { -not => undef } } );
my $q_count = $questionnaires->count();
$mech->content_contains( "$q_count questionnaires sent" );
@@ -130,12 +130,12 @@ subtest 'check summary counts' => sub {
$alert->update;
};
- FixMyStreet::App->model('DB::Problem')->search( { bodies_str => 1 } )->update( { bodies_str => 2489 } );
+ FixMyStreet::DB->resultset('Problem')->search( { bodies_str => 1 } )->update( { bodies_str => 2489 } );
ok $mech->host('www.fixmystreet.com');
};
subtest "Check admin_base_url" => sub {
- my $rs = FixMyStreet::App->model('DB::Problem');
+ my $rs = FixMyStreet::DB->resultset('Problem');
my $cobrand = $report->get_cobrand_logged;
is ($report->admin_url($cobrand),