aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-08-24 19:26:24 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-08-31 15:37:09 +0100
commitb1adf1baaf422a43c17e9a33f698c97d76a5f027 (patch)
treedf2a8e7aee412b2e53483a6dc335191a1adccf87 /t
parent986c97311c4cb1f3ec092c0605dcb15ab2527da1 (diff)
Admin interface for editing report states.
Diffstat (limited to 't')
-rw-r--r--t/app/controller/admin_states.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/app/controller/admin_states.t b/t/app/controller/admin_states.t
new file mode 100644
index 000000000..60ffe5b88
--- /dev/null
+++ b/t/app/controller/admin_states.t
@@ -0,0 +1,24 @@
+use FixMyStreet::TestMech;
+
+my $mech = FixMyStreet::TestMech->new;
+
+my $user = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1);
+
+$mech->log_in_ok( $user->email );
+
+subtest 'basic states admin' => sub {
+ $mech->get_ok('/admin/states');
+ $mech->submit_form_ok({ button => 'new', with_fields => { label => 'third party', type => 'closed', name => 'Third party referral' } });
+ $mech->content_contains('Third party referral');
+ $mech->content_contains('Fixed');
+ $mech->submit_form_ok({ button => 'delete:fixed' });
+ $mech->content_lacks('Fixed');
+ $mech->submit_form_ok({ form_number => 2, button => 'new_fixed' });
+ $mech->content_contains('Fixed');
+ $mech->submit_form_ok({ with_fields => { 'name:third party' => 'Third party incident' } });
+ $mech->content_contains('Third party incident');
+};
+
+# TODO Language tests
+
+done_testing;