aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_display.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-06-27 11:03:57 +0100
committerStruan Donald <struan@exo.org.uk>2011-06-27 11:03:57 +0100
commita20fc533b0f10646814742f1348c5f9141217efa (patch)
tree742b49b1347262bd971e397f1d3d52be7c7140d7 /t/app/controller/report_display.t
parentdf18e6c8b434dfd86177cf5041278fd46d6d2ea7 (diff)
change to use from_council in users table and store the council id in
there so we can check that the problem is for the council the user is from
Diffstat (limited to 't/app/controller/report_display.t')
-rw-r--r--t/app/controller/report_display.t19
1 files changed, 13 insertions, 6 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index fc844e31c..23b76fbc4 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -311,24 +311,31 @@ for my $test (
for my $test (
{
desc => 'no state dropdown if user not from authority',
- from_authority => 0,
+ from_council => 0,
+ no_state => 1,
},
{
desc => 'state dropdown if user from authority',
- from_authority => 1,
+ from_council => 2504,
+ no_state => 0,
+ },
+ {
+ desc => 'no state dropdown if user not from same council as problem',
+ from_council => 2505,
+ no_state => 1,
},
) {
subtest $test->{desc} => sub {
$mech->log_in_ok( $user->email );
- $user->from_authority( $test->{from_authority} );
+ $user->from_council( $test->{from_council} );
$user->update;
$mech->get_ok("/report/$report_id");
my $fields = $mech->visible_form_values( 'updateForm' );
- if ( $test->{from_authority} ) {
- ok $fields->{state};
- } else {
+ if ( $test->{no_state} ) {
ok !$fields->{state};
+ } else {
+ ok $fields->{state};
}
};
}