From 0796a2b6821e75e22ec6eacd3950ef916b16303d Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 3 May 2019 19:43:00 +0100 Subject: Update a number of packages. Update: * Catalyst * Specify Catalyst::DispatchType::Regex explicitly * Remove Catalyst::Plugin::Unicode::Encoding * Catalyst::Plugin::SmartURI * Specify URI::SmartURI explicitly * Catalyst::Plugin::Static::Simple * CGI * Class::Load * DateTime * DateTime::TimeZone * DBD::Pg * DBIx::Class * DBIx::Class::EncodedColumn. * Email::Address. * Email::MIME * ExtUtils::MakeMaker * ExtUtils::ParseXS (for Params::Classify upgrade) * File::ChangeNotify * Image::Size * IO::Socket::SSL * local::lib * Moo * Moose (and some related others due to deprecations) * namespace::autoclean * Net::Server * Net::SSLeay * Number::Phone * Plack * Starman * Template * Test::PostgreSQL * Test::WWW::Mechanize::Catalyst * Text::CSV * YAML carton install was run on a wheezy box, the oldest that is supported, to make sure the required minimal vesions of core modules weren't removed from the snapshot. Cpanel::JSON::XS, Devel::GlobalDestruction::XS, and MooseX::NonMoose were then put back in the snapshot, in case another system needs them (e.g. system Perl on Mac looks for MooseX::NonMoose). --- t/app/controller/admin.t | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 't/app/controller/admin.t') 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 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), -- cgit v1.2.3