diff options
-rw-r--r-- | bin/export-norwegian-contacts | 10 | ||||
-rwxr-xr-x | bin/import-categories | 10 | ||||
-rwxr-xr-x | bin/load-contacts | 10 | ||||
-rwxr-xr-x | bin/load-norwegian-contacts | 10 | ||||
-rwxr-xr-x | bin/problem-creation-graph | 4 | ||||
-rwxr-xr-x | bin/problems-filed-graph | 4 | ||||
-rwxr-xr-x | bin/rotate-photos | 10 | ||||
-rwxr-xr-x | bin/send-reports | 4 | ||||
-rwxr-xr-x | bin/showcouncilrates | 10 | ||||
-rwxr-xr-x | bin/test-mailin | 2 | ||||
-rwxr-xr-x | bin/test-run | 4 | ||||
-rwxr-xr-x | bin/update-areas | 10 | ||||
-rw-r--r-- | conf/packages | 2 | ||||
-rw-r--r-- | notes/INSTALL | 6 | ||||
-rw-r--r-- | perl-external/modules.txt | 1 | ||||
-rw-r--r-- | t/app/controller/alert_new.t | 2 | ||||
-rw-r--r-- | t/app/controller/contact.t | 6 | ||||
-rw-r--r-- | t/app/controller/report_display.t | 18 | ||||
-rw-r--r-- | t/app/controller/report_updates.t | 16 | ||||
-rw-r--r-- | t/app/model/alert_type.t | 2 |
20 files changed, 70 insertions, 71 deletions
diff --git a/bin/export-norwegian-contacts b/bin/export-norwegian-contacts index 8a7d438e5..0209c6512 100644 --- a/bin/export-norwegian-contacts +++ b/bin/export-norwegian-contacts @@ -31,11 +31,11 @@ use mySociety::MaPit; BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) ); } diff --git a/bin/import-categories b/bin/import-categories index add12d3d0..e9008b93f 100755 --- a/bin/import-categories +++ b/bin/import-categories @@ -24,11 +24,11 @@ use mySociety::VotingArea; BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) ); } diff --git a/bin/load-contacts b/bin/load-contacts index 0fa76ca11..b18699db1 100755 --- a/bin/load-contacts +++ b/bin/load-contacts @@ -23,11 +23,11 @@ use mySociety::Random; BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) ); if (!dbh()->selectrow_array('select secret from secret for update of secret')) { diff --git a/bin/load-norwegian-contacts b/bin/load-norwegian-contacts index f7466ad2a..b73778848 100755 --- a/bin/load-norwegian-contacts +++ b/bin/load-norwegian-contacts @@ -25,11 +25,11 @@ use mySociety::Random; BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) ); if (!dbh()->selectrow_array('select secret from secret for update of secret')) { diff --git a/bin/problem-creation-graph b/bin/problem-creation-graph index 6d34d3b49..4bba1cdb8 100755 --- a/bin/problem-creation-graph +++ b/bin/problem-creation-graph @@ -18,7 +18,7 @@ cd `dirname $0` cd ../../ source fixmystreet/commonlib/shlib/deployfns -read_conf fixmystreet/conf/general +read_conf fixmystreet/conf/general.yml if [ $OPTION_BASE_URL = "http://reportemptyhomes.com" ]; then DATE="2008-10-01" @@ -42,7 +42,7 @@ function grab_data { $1 group by date(created) order by date(created) - ;" | psql --host $OPTION_BCI_DB_HOST --port $OPTION_BCI_DB_PORT -A -F " " $OPTION_BCI_DB_NAME $OPTION_BCI_DB_USER | egrep -v "date|rows" >$2 + ;" | psql --host $OPTION_FMS_DB_HOST --port $OPTION_FMS_DB_PORT -A -F " " $OPTION_FMS_DB_NAME $OPTION_FMS_DB_USER | egrep -v "date|rows" >$2 } # rather nastily, work out the cumulative heights in reverse, so can plot impulses on top of each other diff --git a/bin/problems-filed-graph b/bin/problems-filed-graph index 702bea651..dbac35639 100755 --- a/bin/problems-filed-graph +++ b/bin/problems-filed-graph @@ -18,7 +18,7 @@ cd `dirname $0` cd ../../ source fixmystreet/commonlib/shlib/deployfns -read_conf fixmystreet/conf/general +read_conf fixmystreet/conf/general.yml SOURCEO=/tmp/bci-report-rate-graph-data-nonwmc-$RANDOM$RANDOM GPSCRIPT=/tmp/bci-report-rate-graph-script-$RANDOM$RANDOM @@ -29,7 +29,7 @@ echo "select where state not in ('unconfirmed', 'hidden') group by date(created) order by date(created) - ;" | psql --host $OPTION_BCI_DB_HOST --port $OPTION_BCI_DB_PORT -A -F " " $OPTION_BCI_DB_NAME $OPTION_BCI_DB_USER | egrep -v "date|rows" >$SOURCEO + ;" | psql --host $OPTION_FMS_DB_HOST --port $OPTION_FMS_DB_PORT -A -F " " $OPTION_FMS_DB_NAME $OPTION_FMS_DB_USER | egrep -v "date|rows" >$SOURCEO #echo "source $SOURCEO" cat >$GPSCRIPT <<END diff --git a/bin/rotate-photos b/bin/rotate-photos index 84c713926..faf2748e6 100755 --- a/bin/rotate-photos +++ b/bin/rotate-photos @@ -24,11 +24,11 @@ use mySociety::TempFiles; BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) ); } diff --git a/bin/send-reports b/bin/send-reports index 427d02ec8..f1d8c5742 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -290,6 +290,10 @@ while (my $row = $unsent->next) { $result *= 0; } else { $result *= 1; + # temporary fix to resolve some issues with west berks + if ( $row->council =~ /2619/ ) { + $result *= 0; + } } } } diff --git a/bin/showcouncilrates b/bin/showcouncilrates index 9ae5c3e7b..cc8ce8d10 100755 --- a/bin/showcouncilrates +++ b/bin/showcouncilrates @@ -16,11 +16,11 @@ use FixMyStreet::Geocode::OSM; BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) ); } diff --git a/bin/test-mailin b/bin/test-mailin index 96e2022c0..3f101b438 100755 --- a/bin/test-mailin +++ b/bin/test-mailin @@ -29,7 +29,7 @@ use mySociety::WebTestHarness; print_log('notice', "started"); our $wth = new mySociety::WebTestHarness(); -$wth->database_connect('BCI_'); +$wth->database_connect('FMS_'); print_log('notice', "reading mail from STDIN"); my $slurped = read_file(\*STDIN); print_log('notice', "calling email_incoming"); diff --git a/bin/test-run b/bin/test-run index 58cf0b2ea..29e975ce4 100755 --- a/bin/test-run +++ b/bin/test-run @@ -5,7 +5,7 @@ # # Requires: # * ../conf/general file set up for FixMyStreet, and matching the below requirements -# * apache configured to serve ../web on OPTION_BASE_URL +# * apache configured to serve ../web on BASE_URL # * a database with name ending "_testharness"; this script will drop and remake the # database, so make sure it is never used for anything important # * email addresses (email_n below) configured to pipe to ./test-mailin with fast @@ -54,7 +54,7 @@ date_print("Set up web test harness..."); my ($wth, $action, $verbose, $pause, $multispawn) = mySociety::WebTestHarness::setup({ actions => \@actions, actions_desc => \%actions_desc, - dbname => 'BCI', + dbname => 'FMS', 'sql_extra' => ['../db/alert_types.sql'], }); $multispawn = 1; diff --git a/bin/update-areas b/bin/update-areas index bbc933faf..a8cc01769 100755 --- a/bin/update-areas +++ b/bin/update-areas @@ -24,11 +24,11 @@ use mySociety::VotingArea; BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); mySociety::DBHandle::configure( - Name => mySociety::Config::get('BCI_DB_NAME'), - User => mySociety::Config::get('BCI_DB_USER'), - Password => mySociety::Config::get('BCI_DB_PASS'), - Host => mySociety::Config::get('BCI_DB_HOST', undef), - Port => mySociety::Config::get('BCI_DB_PORT', undef) + Name => mySociety::Config::get('FMS_DB_NAME'), + User => mySociety::Config::get('FMS_DB_USER'), + Password => mySociety::Config::get('FMS_DB_PASS'), + Host => mySociety::Config::get('FMS_DB_HOST', undef), + Port => mySociety::Config::get('FMS_DB_PORT', undef) ); } diff --git a/conf/packages b/conf/packages index 15fb8dca3..3168be1e5 100644 --- a/conf/packages +++ b/conf/packages @@ -32,4 +32,4 @@ libyaml-perl liblist-moreutils-perl libhaml-ruby libtemplate-perl -postgresql-server-dev-8.3 +postgresql-server-dev-8.4 diff --git a/notes/INSTALL b/notes/INSTALL index 56be765db..7287aa3d3 100644 --- a/notes/INSTALL +++ b/notes/INSTALL @@ -65,12 +65,6 @@ If you need to add a module do it using: and it will update all the relevant bits. -Currently, you probably need to add EncodedColumn manually: - - module-manage.pl add DBIx::Class::EncodedColumn - -...because it's explicitly overridden in the code, which is fooling the installer. - If a module won't build (Test::WWW::Mechanize and HTTP::Server::Simple fail tests for me but the failures are not pertinent) then the module-manage script will bail out. Look in ~/.cpanm/build_log to see what went wrong. You can force diff --git a/perl-external/modules.txt b/perl-external/modules.txt index f2e6a92ad..5ad9b477c 100644 --- a/perl-external/modules.txt +++ b/perl-external/modules.txt @@ -21,6 +21,7 @@ Config::General Crypt::Eksblowfish::Bcrypt DBIx::Class DBIx::Class::EncodedColumn +DBIx::Class::EncodedColumn::Crypt::Eksblowfish::Bcrypt DBIx::Class::FilterColumn DBIx::Class::Schema::Loader DBIx::Class::Storage::DBI diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t index 950666d2d..5ea73625a 100644 --- a/t/app/controller/alert_new.t +++ b/t/app/controller/alert_new.t @@ -452,7 +452,7 @@ subtest "Test normal alert signups and that alerts are sent" => sub { $count++ if $_->body =~ /The following updates have been left on this problem:/; $count++ if $_->body =~ /The following new problems have been reported to City of\s*Edinburgh Council:/; $count++ if $_->body =~ /The following nearby problems have been added:/; - $count++ if $_->body =~ / - Testing, EH1 1BB/; + $count++ if $_->body =~ / -\s+Testing, EH1 1BB/; } is $count, 5, 'Five emails with the right things in them'; diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t index 86b845eb3..970241d12 100644 --- a/t/app/controller/contact.t +++ b/t/app/controller/contact.t @@ -21,7 +21,7 @@ for my $test ( postcode => 'EH99 1SP', confirmed => '2011-05-04 10:44:28.145168', anonymous => 0, - meta => 'Reported by A User at 10:44, Wednesday 4 May 2011', + meta => 'Reported by A User at 10:44, Wed 4 May 2011', main => 1, }, { @@ -32,7 +32,7 @@ for my $test ( postcode => 'EH99 1SP', confirmed => '2011-05-03 13:24:28.145168', anonymous => 1, - meta => 'Reported anonymously at 13:24, Tuesday 3 May 2011', + meta => 'Reported anonymously at 13:24, Tue 3 May 2011', }, { name => 'A User', @@ -42,7 +42,7 @@ for my $test ( postcode => 'EH99 1SP', confirmed => '2011-05-03 13:24:28.145168', anonymous => 1, - meta => 'Reported anonymously at 13:24, Tuesday 3 May 2011', + meta => 'Reported anonymously at 13:24, Tue 3 May 2011', update => { name => 'Different User', email => 'commenter@example.com', diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index c7455a99b..548580fe1 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -103,7 +103,7 @@ subtest "test a good report" => sub { is $mech->uri->path, "/report/$report_id", "at /report/$report_id"; is $mech->extract_problem_title, 'Test 2', 'problem title'; is $mech->extract_problem_meta, - 'Reported by Test User at 15:47, Saturday 16 April 2011', + 'Reported by Test User at 15:47, Sat 16 April 2011', 'correct problem meta information'; $mech->content_contains('Test 2 Detail'); @@ -124,55 +124,55 @@ foreach my $meta ( anonymous => 'f', category => 'Other', service => '', - meta => 'Reported by Test User at 15:47, Saturday 16 April 2011' + meta => 'Reported by Test User at 15:47, Sat 16 April 2011' }, { anonymous => 'f', category => 'Roads', service => '', meta => -'Reported in the Roads category by Test User at 15:47, Saturday 16 April 2011' +'Reported in the Roads category by Test User at 15:47, Sat 16 April 2011' }, { anonymous => 'f', category => '', service => 'Transport service', meta => -'Reported by Transport service by Test User at 15:47, Saturday 16 April 2011' +'Reported by Transport service by Test User at 15:47, Sat 16 April 2011' }, { anonymous => 'f', category => 'Roads', service => 'Transport service', meta => -'Reported by Transport service in the Roads category by Test User at 15:47, Saturday 16 April 2011' +'Reported by Transport service in the Roads category by Test User at 15:47, Sat 16 April 2011' }, { anonymous => 't', category => 'Other', service => '', - meta => 'Reported anonymously at 15:47, Saturday 16 April 2011' + meta => 'Reported anonymously at 15:47, Sat 16 April 2011' }, { anonymous => 't', category => 'Roads', service => '', meta => -'Reported in the Roads category anonymously at 15:47, Saturday 16 April 2011' +'Reported in the Roads category anonymously at 15:47, Sat 16 April 2011' }, { anonymous => 't', category => '', service => 'Transport service', meta => -'Reported by Transport service anonymously at 15:47, Saturday 16 April 2011' +'Reported by Transport service anonymously at 15:47, Sat 16 April 2011' }, { anonymous => 't', category => 'Roads', service => 'Transport service', meta => -'Reported by Transport service in the Roads category anonymously at 15:47, Saturday 16 April 2011' +'Reported by Transport service in the Roads category anonymously at 15:47, Sat 16 April 2011' }, ) { diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index 5719b13e3..39cb5d6d8 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -81,7 +81,7 @@ for my $test ( anonymous => 'f', mark_fixed => 'false', mark_open => 'false', - meta => 'Posted by Other User at 15:47, Saturday 16 April 2011', + meta => 'Posted by Other User at 15:47, Sat 16 April 2011', }, { description => 'blank user, anon is false', @@ -89,7 +89,7 @@ for my $test ( anonymous => 'f', mark_fixed => 'false', mark_open => 'false', - meta => 'Posted anonymously at 15:47, Saturday 16 April 2011', + meta => 'Posted anonymously at 15:47, Sat 16 April 2011', }, { description => 'named user, anon is true', @@ -97,7 +97,7 @@ for my $test ( anonymous => 't', mark_fixed => 'false', mark_open => 'false', - meta => 'Posted anonymously at 15:47, Saturday 16 April 2011', + meta => 'Posted anonymously at 15:47, Sat 16 April 2011', }, { description => 'named user, anon is true, fixed', @@ -106,7 +106,7 @@ for my $test ( mark_fixed => 'true', mark_open => 'false', meta => -'Posted anonymously at 15:47, Saturday 16 April 2011, marked as fixed', +'Posted anonymously at 15:47, Sat 16 April 2011, marked as fixed', }, { description => 'named user, anon is true, reopened', @@ -114,7 +114,7 @@ for my $test ( anonymous => 't', mark_fixed => 'false', mark_open => 'true', - meta => 'Posted anonymously at 15:47, Saturday 16 April 2011, reopened', + meta => 'Posted anonymously at 15:47, Sat 16 April 2011, reopened', } ) { @@ -185,9 +185,9 @@ subtest "several updates shown in correct order" => sub { my $meta = $mech->extract_update_metas; is scalar @$meta, 3, 'number of updates'; - is $meta->[0], 'Posted by Other User at 12:23, Thursday 10 March 2011', 'first update'; - is $meta->[1], 'Posted by Main User at 12:23, Thursday 10 March 2011', 'second update'; - is $meta->[2], 'Posted anonymously at 08:12, Tuesday 15 March 2011, marked as fixed', 'third update'; + is $meta->[0], 'Posted by Other User at 12:23, Thu 10 March 2011', 'first update'; + is $meta->[1], 'Posted by Main User at 12:23, Thu 10 March 2011', 'second update'; + is $meta->[2], 'Posted anonymously at 08:12, Tue 15 March 2011, marked as fixed', 'third update'; }; for my $test ( diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t index 1adc584d7..6767d43fc 100644 --- a/t/app/model/alert_type.t +++ b/t/app/model/alert_type.t @@ -199,7 +199,7 @@ for my $test ( $mech->email_count_is( 1 ); my $email = $mech->get_email; my $pc = $test->{expected_postcode}; - my $title = $report->title; + (my $title = $report->title) =~ s/ /\\s+/; my $body = $email->body; like $body, qr#report/$report_id - $title, $pc#, 'email contains expected postcode'; |