|
| 1 | +Feature: Agenda Search - Filter Locations Based on State |
| 2 | + |
| 3 | + Background: Push content |
| 4 | + When we post json to "/push" |
| 5 | + """ |
| 6 | + { |
| 7 | + "guid": "event1", "type": "event", "state": "scheduled", "pubstatus": "usable", |
| 8 | + "slugline": "New Press Conference", |
| 9 | + "name": "Prime minister press conference", |
| 10 | + "dates": { |
| 11 | + "start": "2018-05-28T04:00:00+0000", |
| 12 | + "end": "2018-05-28T05:00:00+0000", |
| 13 | + "tz": "Australia/Sydney" |
| 14 | + }, |
| 15 | + "calendars": [{"qcode": "cal1", "name": "Calendar1"}], |
| 16 | + "subject": [ |
| 17 | + {"code": "d1", "scheme": "sttdepartment", "name": "Dep1"}, |
| 18 | + {"code": "s1", "scheme": "sttsubj", "name": "Sub1"}, |
| 19 | + {"code": "e1", "scheme": "event_type", "name": "Sports"} |
| 20 | + ], |
| 21 | + "place": [ |
| 22 | + {"code": "NSW", "name": "New South Wales"} |
| 23 | + ], |
| 24 | + "anpa_category": [ |
| 25 | + {"qcode": "e", "name": "Entertainment"}, |
| 26 | + {"qcode": "f", "name": "Finance"} |
| 27 | + ], |
| 28 | + "location": [{ |
| 29 | + "name": "Sydney Harbour Bridge", |
| 30 | + "address": { |
| 31 | + "city": "Sydney", |
| 32 | + "state": "New South Wales", |
| 33 | + "country": "Australia", |
| 34 | + "line": ["Hickson Road"], |
| 35 | + "postal_code": "2000", |
| 36 | + "type": "attraction", |
| 37 | + "title": "Sydney Harbour Bridge", |
| 38 | + "area": "Council of the City of Sydney" |
| 39 | + } |
| 40 | + }] |
| 41 | + } |
| 42 | + """ |
| 43 | + And we post json to "/push" |
| 44 | + """ |
| 45 | + { |
| 46 | + "guid": "event4", "type": "event", "state": "killed", "pubstatus": "cancelled", |
| 47 | + "slugline": "Cancelled Melbourne Event", |
| 48 | + "name": "Cancelled Melbourne Event", |
| 49 | + "dates": { |
| 50 | + "start": "2018-05-28T04:00:00+0000", |
| 51 | + "end": "2018-05-28T05:00:00+0000", |
| 52 | + "tz": "Australia/Sydney" |
| 53 | + }, |
| 54 | + "calendars": [{"qcode": "cal2", "name": "Calendar2"}], |
| 55 | + "subject": [ |
| 56 | + {"code": "d2", "scheme": "sttdepartment", "name": "Dep2"}, |
| 57 | + {"code": "s2", "scheme": "sttsubj", "name": "Sub2"}, |
| 58 | + {"code": "e2", "scheme": "event_type", "name": "Music"} |
| 59 | + ], |
| 60 | + "place": [ |
| 61 | + {"code": "VIC", "name": "Victoria"} |
| 62 | + ], |
| 63 | + "anpa_category": [ |
| 64 | + {"qcode": "e", "name": "Entertainment"}, |
| 65 | + {"qcode": "f", "name": "Finance"} |
| 66 | + ], |
| 67 | + "location": [{ |
| 68 | + "name": "Cancelled Melbourne Location", |
| 69 | + "address": { |
| 70 | + "city": "Melbourne", |
| 71 | + "state": "Victoria", |
| 72 | + "country": "Australia", |
| 73 | + "line": ["Cancelled Street"], |
| 74 | + "postal_code": "3000", |
| 75 | + "type": "stadium", |
| 76 | + "title": "Cancelled Melbourne Location", |
| 77 | + "area": "Yarra Park" |
| 78 | + } |
| 79 | + }] |
| 80 | + } |
| 81 | + """ |
| 82 | + |
| 83 | + @auth @admin |
| 84 | + Scenario: Verify locations are filtered based on event state |
| 85 | + When we get "/agenda/search_locations" |
| 86 | + Then we get existing resource |
| 87 | + """ |
| 88 | + { |
| 89 | + "regions": [ |
| 90 | + {"type": "city", "country": "Australia", "state": "New South Wales", "name": "Sydney"} |
| 91 | + ], |
| 92 | + "places": [ |
| 93 | + "Sydney Harbour Bridge" |
| 94 | + ] |
| 95 | + } |
| 96 | + """ |
0 commit comments