aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_updates.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-14 12:11:13 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-15 00:11:06 +0000
commitff06783c6dc50321100a54b4d4a624fde2212689 (patch)
tree38d7f914f841a6ba8ea3225bae3cacbabc80dbf9 /t/app/controller/report_updates.t
parentbb356c880412db8bad655e081ad6d68f25ae3ff7 (diff)
Make from_body a foreign key.
Diffstat (limited to 't/app/controller/report_updates.t')
-rw-r--r--t/app/controller/report_updates.t12
1 files changed, 7 insertions, 5 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index fe1c27199..5accb9ce4 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -409,7 +409,7 @@ $report->update;
subtest 'check non authority user cannot change set state' => sub {
$mech->log_in_ok( $user->email );
- $user->from_body( 0 );
+ $user->from_body( undef );
$user->update;
$mech->get_ok("/report/$report_id");
@@ -434,6 +434,8 @@ subtest 'check non authority user cannot change set state' => sub {
is $report->state, 'confirmed', 'state unchanged';
};
+$mech->create_body_ok(2504, 'Westminster City Council');
+
for my $state ( qw/unconfirmed hidden partial/ ) {
subtest "check that update cannot set state to $state" => sub {
$mech->log_in_ok( $user->email );
@@ -547,13 +549,13 @@ for my $test (
state => 'fixed',
},
state => 'fixed - council',
- report_councils => '2504,2505',
+ report_bodies => '2504,2505',
},
) {
subtest $test->{desc} => sub {
$report->comments->delete;
- if ( $test->{ report_councils } ) {
- $report->bodies_str( $test->{ report_councils } );
+ if ( $test->{ report_bodies } ) {
+ $report->bodies_str( $test->{ report_bodies } );
$report->update;
}
@@ -629,7 +631,7 @@ subtest 'check meta correct for comments marked confirmed but not marked open' =
unlike $update_meta->[0], qr/reopened$/, 'update meta does not say reopened';
};
-$user->from_body(0);
+$user->from_body(undef);
$user->update;
$report->state('confirmed');