aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/model/problem.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2011-08-22 11:22:33 +0100
committerStruan Donald <struan@exo.org.uk>2011-08-22 11:22:33 +0100
commit44c31ab8efbd97086e17d26c819b1d5b4946ce43 (patch)
tree5a509a5006afd50f4c48f52fdf45ac9ac86ac054 /t/app/model/problem.t
parentf93ff062c986847f97aef76673c2ca7742f1f125 (diff)
parenta9a4fed583d7467c9c1f1fa56d42bcb75b4b488c (diff)
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into open311-consumer
Conflicts: t/app/model/problem.t templates/web/default/report/new/fill_in_details.html web/css/core.css
Diffstat (limited to 't/app/model/problem.t')
-rw-r--r--t/app/model/problem.t88
1 files changed, 88 insertions, 0 deletions
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index ed5207c2b..ad42c5fdf 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -257,6 +257,94 @@ for my $test (
};
}
+for my $test (
+ {
+ state => 'partial',
+ is_visible => 0,
+ is_fixed => 0,
+ is_open => 0,
+ is_closed => 0,
+ },
+ {
+ state => 'hidden',
+ is_visible => 0,
+ is_fixed => 0,
+ is_open => 0,
+ is_closed => 0,
+ },
+ {
+ state => 'unconfirmed',
+ is_visible => 0,
+ is_fixed => 0,
+ is_open => 0,
+ is_closed => 0,
+ },
+ {
+ state => 'confirmed',
+ is_visible => 1,
+ is_fixed => 0,
+ is_open => 1,
+ is_closed => 0,
+ },
+ {
+ state => 'investigating',
+ is_visible => 1,
+ is_fixed => 0,
+ is_open => 1,
+ is_closed => 0,
+ },
+ {
+ state => 'planned',
+ is_visible => 1,
+ is_fixed => 0,
+ is_open => 1,
+ is_closed => 0,
+ },
+ {
+ state => 'in progress',
+ is_visible => 1,
+ is_fixed => 0,
+ is_open => 1,
+ is_closed => 0,
+ },
+ {
+ state => 'fixed',
+ is_visible => 1,
+ is_fixed => 1,
+ is_open => 0,
+ is_closed => 0,
+ },
+ {
+ state => 'fixed - council',
+ is_visible => 1,
+ is_fixed => 1,
+ is_open => 0,
+ is_closed => 0,
+ },
+ {
+ state => 'fixed - user',
+ is_visible => 1,
+ is_fixed => 1,
+ is_open => 0,
+ is_closed => 0,
+ },
+ {
+ state => 'closed',
+ is_visible => 1,
+ is_fixed => 0,
+ is_open => 0,
+ is_closed => 1,
+ },
+) {
+ subtest $test->{state} . ' is fixed/open/closed/visible' => sub {
+ $problem->state( $test->{state} );
+ is $problem->is_visible, $test->{is_visible}, 'is_visible';
+ is $problem->is_fixed, $test->{is_fixed}, 'is_fixed';
+ is $problem->is_closed, $test->{is_closed}, 'is_closed';
+ is $problem->is_open, $test->{is_open}, 'is_open';
+ };
+}
+
$problem->comments->delete;
$problem->delete;
$user->delete;