diff options
author | Struan Donald <struan@exo.org.uk> | 2020-03-04 15:40:34 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-03-16 11:12:32 +0000 |
commit | c7c189f286220dc39849baa0d560db6def7461aa (patch) | |
tree | 96bcebbafcb99062afe4c6d3398d32f8b8c450cc | |
parent | a535ec263a6bcb98a74875f494493586a618cbca (diff) |
[IsleOfWight] category for front page report title
-rw-r--r-- | t/cobrand/isleofwight.t | 16 | ||||
-rw-r--r-- | templates/web/isleofwight/report/_item_heading.html | 7 |
2 files changed, 23 insertions, 0 deletions
diff --git a/t/cobrand/isleofwight.t b/t/cobrand/isleofwight.t index 0c985e2fb..3cac710da 100644 --- a/t/cobrand/isleofwight.t +++ b/t/cobrand/isleofwight.t @@ -137,6 +137,22 @@ subtest "check moderation label uses correct name" => sub { }; }; +subtest "front page summary uses report category not title" => sub { + my $category = $reports[0]->category; + ok $category, "category is not blank"; + my $title = $reports[0]->title; + ok $title, "title is not blank"; + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => ['isleofwight'], + }, sub { + $mech->log_out_ok; + $mech->get_ok('/'); + $mech->content_like( qr/item-list__heading">$category/ ); + $mech->content_unlike( qr/item-list__heading">$title/ ); + }; +}; + $_->delete for @reports; my $system_user = $mech->create_user_ok('system_user@example.org'); diff --git a/templates/web/isleofwight/report/_item_heading.html b/templates/web/isleofwight/report/_item_heading.html new file mode 100644 index 000000000..90010a548 --- /dev/null +++ b/templates/web/isleofwight/report/_item_heading.html @@ -0,0 +1,7 @@ +[% + SET title = problem.title; + IF c.req.uri.path == '/'; + title = problem.category_display; + END; +%] +<h3 class="item-list__heading">[% title %]</h3> |