From 21877e063f8ab9c5914adbc88c8210d2393671ae Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 22 Nov 2016 15:38:07 +0000 Subject: Add shortlist buttons to report lists. This includes adding/removing reports from a user's shortlist, and manual reordering of a shortlist with up/down buttons. The backend code can cope with an item moving to any point in the list. --- t/app/controller/my_planned.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't/app/controller/my_planned.t') diff --git a/t/app/controller/my_planned.t b/t/app/controller/my_planned.t index 7bd1dd2cd..d66673589 100644 --- a/t/app/controller/my_planned.t +++ b/t/app/controller/my_planned.t @@ -40,9 +40,9 @@ $mech->content_contains('Test Title'); $mech->get_ok($problem->url); $mech->content_contains('Shortlisted'); -$mech->submit_form_ok({ with_fields => { change => 'remove' } }); +$mech->submit_form_ok({ with_fields => { 'shortlist-remove' => 1 } }); $mech->content_contains('Shortlist'); -$mech->submit_form_ok({ with_fields => { change => 'add' } }); +$mech->submit_form_ok({ with_fields => { 'shortlist-add' => 1 } }); $mech->content_contains('Shortlisted'); done_testing(); -- cgit v1.2.3 From 111acf7ccb452a7c163682b73b9cf5aee5f98be1 Mon Sep 17 00:00:00 2001 From: pezholio Date: Mon, 30 Jan 2017 14:54:50 +0000 Subject: Return JSON if `ajax` in params --- t/app/controller/my_planned.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 't/app/controller/my_planned.t') diff --git a/t/app/controller/my_planned.t b/t/app/controller/my_planned.t index d66673589..fa463e61e 100644 --- a/t/app/controller/my_planned.t +++ b/t/app/controller/my_planned.t @@ -45,6 +45,18 @@ $mech->content_contains('Shortlist'); $mech->submit_form_ok({ with_fields => { 'shortlist-add' => 1 } }); $mech->content_contains('Shortlisted'); +$mech->get_ok('/my/planned?sort=shortlist&ajax=1'); +$mech->content_contains('shortlist-up'); +$mech->content_contains('shortlist-down'); + +$mech->get_ok('/my/planned?sort=created-desc&ajax=1'); +$mech->content_lacks('shortlist-up'); +$mech->content_lacks('shortlist-down'); + +$mech->get_ok('/my/planned?ajax=1'); +$mech->content_contains('shortlist-up'); +$mech->content_contains('shortlist-down'); + done_testing(); END { -- cgit v1.2.3