From bccf92ebac21f17d7d426f32adf8112cad078a34 Mon Sep 17 00:00:00 2001 From: Rebecca Appleyard Date: Thu, 13 Sep 2018 15:10:28 +0100 Subject: [PATCH 1/3] [WEBDEV-682] Proposed Negative SIs * Created controller. * Created index and show page serializers. * Refactored out list page serializer. * Refactored out laid thing show page serializer. --- Gemfile.lock | 2 +- ...gative_statutory_instruments_controller.rb | 25 ++ .../laid_thing_show_page_serializer.rb | 51 +++++ .../page_serializer/list_page_serializer.rb | 43 ++++ ...utory_instruments_index_page_serializer.rb | 25 ++ ...tutory_instruments_show_page_serializer.rb | 50 ++++ ...utory_instruments_index_page_serializer.rb | 30 +-- ...tutory_instruments_show_page_serializer.rb | 44 +--- ...e_statutory_instruments_controller_spec.rb | 90 ++++++++ .../index/fixture.yml | 214 ++++++++++++++++++ .../show/fixture.yml | 184 +++++++++++++++ .../show/fixture.yml | 16 +- .../fixture.yml | 84 +++++++ .../laid_thing_missing_data.yml | 84 +++++++ .../list_page_serializer/fixture.yml | 0 .../fixture.yml | 111 +++++++++ .../fixture.yml | 169 ++++++++++++++ .../si_missing_data.yml | 161 +++++++++++++ .../fixture.yml | 16 +- .../si_missing_data.yml | 16 +- ...proposed_negativestatutory_instruments.yml | 111 +++++++++ .../calls_the_serializer_correctly.yml | 111 +++++++++ .../renders_expected_JSON_output.yml | 111 +++++++++ ...ve_a_response_with_http_status_ok_200_.yml | 111 +++++++++ .../GET_show/assigns_statutory_instrument.yml | 56 +++++ .../calls_the_serializer_correctly.yml | 56 +++++ .../renders_expected_JSON_output.yml | 56 +++++ ...ve_a_response_with_http_status_ok_200_.yml | 56 +++++ ...e_statutory_instruments_controller_spec.rb | 37 +++ .../laid_thing_show_page_serializer_spec.rb | 47 ++++ .../list_page_serializer_spec.rb | 51 +++++ ..._instruments_index_page_serializer_spec.rb | 18 ++ ...y_instruments_show_page_serializer_spec.rb | 53 +++++ 33 files changed, 2202 insertions(+), 87 deletions(-) create mode 100644 app/controllers/proposed_negative_statutory_instruments_controller.rb create mode 100644 app/serializers/page_serializer/laid_thing_show_page_serializer.rb create mode 100644 app/serializers/page_serializer/list_page_serializer.rb create mode 100644 app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb create mode 100644 app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb create mode 100644 spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb create mode 100644 spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml create mode 100644 spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml create mode 100644 spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml create mode 100644 spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml create mode 100644 spec/fixtures/serializers/page_serializer/list_page_serializer/fixture.yml create mode 100644 spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml create mode 100644 spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml create mode 100644 spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/assigns_proposed_negativestatutory_instruments.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/calls_the_serializer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/navigating_to_the_index_page/renders_expected_JSON_output.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/should_have_a_response_with_http_status_ok_200_.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/assigns_statutory_instrument.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/calls_the_serializer_correctly.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/navigating_to_the_show_page/renders_expected_JSON_output.yml create mode 100644 spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/should_have_a_response_with_http_status_ok_200_.yml create mode 100644 spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb create mode 100644 spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb create mode 100644 spec/serializers/page_serializer/list_page_serializer_spec.rb create mode 100644 spec/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer_spec.rb create mode 100644 spec/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index 4f5184ee..3bf5a485 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -286,4 +286,4 @@ RUBY VERSION ruby 2.5.1p57 BUNDLED WITH - 1.16.1 + 1.16.2 diff --git a/app/controllers/proposed_negative_statutory_instruments_controller.rb b/app/controllers/proposed_negative_statutory_instruments_controller.rb new file mode 100644 index 00000000..c06cf866 --- /dev/null +++ b/app/controllers/proposed_negative_statutory_instruments_controller.rb @@ -0,0 +1,25 @@ +class ProposedNegativeStatutoryInstrumentsController < ApplicationController + # Controller rendering proposed negative statutory instruments index and show pages + before_action :build_request + + ROUTE_MAP = { + index: proc { ParliamentHelper.parliament_request.proposed_negative_statutory_instrument_index }, + show: proc { |params| ParliamentHelper.parliament_request.proposed_negative_statutory_instrument_by_id.set_url_params({ proposed_negative_statutory_instrument_id: params[:proposed_negative_statutory_instrument_id] }) } + }.freeze + + def index + @proposed_negative_statutory_instruments = FilterHelper.filter(@request, 'ProposedNegativeStatutoryInstrumentPaper') + serializer = PageSerializer::ProposedNegativeStatutoryInstrumentsIndexPageSerializer.new(proposed_negative_statutory_instruments: @proposed_negative_statutory_instruments, request_id: app_insights_request_id, data_alternates: @alternates, request_original_url: request.original_url) + + render_page(serializer) + end + + def show + @proposed_negative_statutory_instrument = FilterHelper.filter(@request, 'ProposedNegativeStatutoryInstrumentPaper') + @proposed_negative_statutory_instrument = @proposed_negative_statutory_instrument.first + + serializer = PageSerializer::ProposedNegativeStatutoryInstrumentsShowPageSerializer.new(proposed_negative_statutory_instrument: @proposed_negative_statutory_instrument, request_id: app_insights_request_id, data_alternates: @alternates, request_original_url: request.original_url) + + render_page(serializer) + end +end diff --git a/app/serializers/page_serializer/laid_thing_show_page_serializer.rb b/app/serializers/page_serializer/laid_thing_show_page_serializer.rb new file mode 100644 index 00000000..6b291ffd --- /dev/null +++ b/app/serializers/page_serializer/laid_thing_show_page_serializer.rb @@ -0,0 +1,51 @@ +module PageSerializer + class LaidThingShowPageSerializer < PageSerializer::BasePageSerializer + # Initialise a Laid Thing show page serializer. + # + # @param [] laid_thing a Grom::Node object of type LaidThing. + # @param [String] request_id AppInsights request id + # @param [Array] data_alternates array containing the href and type of the alternative data urls + # @param [String] request_original_url original url of the request + def initialize(laid_thing:, request_id: nil, data_alternates: nil, request_original_url: nil) + @laid_thing = laid_thing + @work_package = @laid_thing.work_package + @laying_body = @laid_thing&.laying&.body + @laying_person = @laid_thing&.laying&.person + @procedure = @work_package&.procedure + + super(request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) + end + + private + + def content; end + + def parent_child_objects + [].tap do |components| + components << object_heading_paragraph(3, 'laid-thing.work-package', "#{@work_package&.graph_id}") + components << object_heading_paragraph(4, 'laid-thing.procedure', "#{@procedure&.name}") + components << object_heading_paragraph(3, 'laid-thing.laying', @laid_thing&.laying&.graph_id) + components << object_heading_paragraph(4, 'laid-thing.laid-date', l(@laid_thing&.laying&.date)) + components << object_heading_paragraph(4, 'laid-thing.laying-body', @laying_body&.name) + components << object_heading_paragraph(4, 'laid-thing.laying-person', @laying_person&.display_name) + components << object_heading_paragraph(3, 'laid-thing.web-link', "#{@laid_thing.web_link}") + end.flatten + end + + def object_heading_paragraph(heading_size, heading_content, paragraph_content) + [].tap do |components| + components << ComponentSerializer::HeadingComponentSerializer.new(content: heading_content, size: heading_size).to_h + components << ComponentSerializer::ParagraphComponentSerializer.new([{ content: paragraph_content }]).to_h + end + end + + def section_objects + [].tap do |components| + components << ComponentSerializer::HeadingComponentSerializer.new(content: 'laid-thing.objects', size: 2).to_h + components << parent_child_objects + components << ComponentSerializer::HeadingComponentSerializer.new(content: connected_statutory_instruments_title, size: 3).to_h + components << ComponentSerializer::ListComponentSerializer.new(display: 'generic', display_data: [display_data(component: 'list')], components: connected_statutory_instruments).to_h + end.flatten + end + end +end diff --git a/app/serializers/page_serializer/list_page_serializer.rb b/app/serializers/page_serializer/list_page_serializer.rb new file mode 100644 index 00000000..937349c9 --- /dev/null +++ b/app/serializers/page_serializer/list_page_serializer.rb @@ -0,0 +1,43 @@ +module PageSerializer + class ListPageSerializer < PageSerializer::BasePageSerializer + # Initialise a list page serializer. + # + # @param [String] page_title title of the page + # @param [String] request_id AppInsights request id + # @param [Array] data_alternates array containing the href and type of the alternative data urls + # @param [String] request_original_url original url of the request + def initialize(page_title: nil, request_id: nil, data_alternates: nil, request_original_url: nil) + @page_title = page_title + @data_alternates = data_alternates + + super(request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) + end + + private + + attr_reader :page_title + + def meta + super(title: page_title) + end + + def content + [].tap do |content| + content << ComponentSerializer::SectionComponentSerializer.new(section_primary_components, type: 'primary').to_h + content << ComponentSerializer::SectionComponentSerializer.new(section_components, type: 'section').to_h + end + end + + def section_primary_components + [ComponentSerializer::Heading1ComponentSerializer.new({ heading_content: page_title }).to_h] + end + + def section_components + [ComponentSerializer::ListComponentSerializer.new(display: 'generic', display_data: [display_data(component: 'list', variant: 'block')], components: list_components).to_h] + end + + def list_components + raise StandardError, 'You must implement #list_components' + end + end +end diff --git a/app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb b/app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb new file mode 100644 index 00000000..28f73486 --- /dev/null +++ b/app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb @@ -0,0 +1,25 @@ +module PageSerializer + class ProposedNegativeStatutoryInstrumentsIndexPageSerializer < ListPageSerializer + # Initialise a Proposed Negative Statutory Instruments index page serializer. + # + # @param [Array] proposed_negative_statutory_instruments an array of Grom::Node objects of type ProposedNegativeStatutoryInstrumentPaper. + # @param [String] request_id AppInsights request id + # @param [Array] data_alternates array containing the href and type of the alternative data urls + # @param [String] request_original_url original url of the request + def initialize(proposed_negative_statutory_instruments:, request_id: nil, data_alternates: nil, request_original_url: nil) + @proposed_negative_statutory_instruments = proposed_negative_statutory_instruments + @data_alternates = data_alternates + @title = 'proposed-negative-statutory-instruments.index.title' + + super(page_title: @title, request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) + end + + private + + def list_components + @proposed_negative_statutory_instruments.map do |statutory_instrument| + ComponentSerializer::LinkComponentSerializer.new(link: statutory_instruments_path(statutory_instrument.graph_id), content: statutory_instrument.name).to_h + end + end + end +end diff --git a/app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb b/app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb new file mode 100644 index 00000000..261eae01 --- /dev/null +++ b/app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb @@ -0,0 +1,50 @@ +module PageSerializer + class ProposedNegativeStatutoryInstrumentsShowPageSerializer < LaidThingShowPageSerializer + # Initialise a Proposed Negative Statutory Instruments show page serializer. + # + # @param [] proposed_negative_statutory_instrument a Grom::Node object of type ProposedNegativeStatutoryInstrumentPaper. + # @param [String] request_id AppInsights request id + # @param [Array] data_alternates array containing the href and type of the alternative data urls + # @param [String] request_original_url original url of the request + def initialize(proposed_negative_statutory_instrument:, request_id: nil, data_alternates: nil, request_original_url: nil) + @proposed_negative_statutory_instrument = proposed_negative_statutory_instrument + @following_statutory_instruments = @proposed_negative_statutory_instrument.statutory_instrument_papers + + super(laid_thing: @proposed_negative_statutory_instrument, request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) + end + + private + + def meta + super(title: title) + end + + def title + @proposed_negative_statutory_instrument.name + end + + def content + [].tap do |components| + components << ComponentSerializer::SectionComponentSerializer.new(section_primary_components, type: 'primary').to_h + components << ComponentSerializer::SectionComponentSerializer.new(section_objects, type: 'section').to_h + end + end + + def section_primary_components + [ComponentSerializer::Heading1ComponentSerializer.new({ subheading_content: 'proposed-negative-statutory-instruments.show.subheading', heading_content: title }).to_h] + end + + def connected_statutory_instruments + @following_statutory_instruments.map do |stat_instrument| + ComponentSerializer::LinkComponentSerializer.new( + link: "/statutory-instruments/#{stat_instrument.graph_id}", + content: stat_instrument.name + ).to_h + end + end + + def connected_statutory_instruments_title + 'proposed-negative-statutory-instruments.show.preceding-title' + end + end +end diff --git a/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb b/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb index 35d670f0..f3ad7490 100644 --- a/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb +++ b/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb @@ -1,5 +1,5 @@ module PageSerializer - class StatutoryInstrumentsIndexPageSerializer < PageSerializer::BasePageSerializer + class StatutoryInstrumentsIndexPageSerializer < ListPageSerializer # Initialise a Statutory Instruments index page serializer. # # @param [Array] statutory_instruments an array of Grom::Node objects of type StatutoryInstrumentPaper. @@ -9,36 +9,14 @@ class StatutoryInstrumentsIndexPageSerializer < PageSerializer::BasePageSerializ def initialize(statutory_instruments:, request_id: nil, data_alternates: nil, request_original_url: nil) @statutory_instruments = statutory_instruments @data_alternates = data_alternates + @title = 'statutory-instruments.index.title' - super(request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) + super(page_title: @title, request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) end private - def meta - super(title: title) - end - - def title - 'statutory-instruments.index.title' - end - - def content - [].tap do |content| - content << ComponentSerializer::SectionComponentSerializer.new(components: section_primary_components, type: 'primary').to_h - content << ComponentSerializer::SectionComponentSerializer.new(components: section_components, type: 'section').to_h - end - end - - def section_primary_components - [ComponentSerializer::Heading1ComponentSerializer.new({ heading_content: title }).to_h] - end - - def section_components - [ComponentSerializer::ListComponentSerializer.new(display: 'generic', display_data: [display_data(component: 'list', variant: 'block')], components: statutory_instruments).to_h] - end - - def statutory_instruments + def list_components @statutory_instruments.map do |statutory_instrument| ComponentSerializer::LinkComponentSerializer.new(link: statutory_instruments_path(statutory_instrument.graph_id), content: statutory_instrument.name).to_h end diff --git a/app/serializers/page_serializer/statutory_instruments_show_page_serializer.rb b/app/serializers/page_serializer/statutory_instruments_show_page_serializer.rb index be94c56b..97d97546 100644 --- a/app/serializers/page_serializer/statutory_instruments_show_page_serializer.rb +++ b/app/serializers/page_serializer/statutory_instruments_show_page_serializer.rb @@ -1,6 +1,6 @@ module PageSerializer - class StatutoryInstrumentsShowPageSerializer < PageSerializer::BasePageSerializer - # Initialise a Statutory Instruments index page serializer. + class StatutoryInstrumentsShowPageSerializer < LaidThingShowPageSerializer + # Initialise a Statutory Instruments show page serializer. # # @param [] statutory_instrument a Grom::Node object of type StatutoryInstrumentPaper. # @param [String] request_id AppInsights request id @@ -8,13 +8,9 @@ class StatutoryInstrumentsShowPageSerializer < PageSerializer::BasePageSerialize # @param [String] request_original_url original url of the request def initialize(statutory_instrument:, request_id: nil, data_alternates: nil, request_original_url: nil) @statutory_instrument = statutory_instrument - @work_package = @statutory_instrument.work_package @preceding_proposed_negative_statutory_instruments = @statutory_instrument.proposed_negative_statutory_instrument_papers - @laying_body = @statutory_instrument&.laying&.body - @laying_person = @statutory_instrument&.laying&.person - @procedure = @work_package&.procedure - super(request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) + super(laid_thing: @statutory_instrument, request_id: request_id, data_alternates: data_alternates, request_original_url: request_original_url) end private @@ -54,35 +50,7 @@ def literals end.compact end - def section_objects - [].tap do |components| - components << ComponentSerializer::HeadingComponentSerializer.new(content: 'statutory-instruments.show.objects', size: 2).to_h - components << parent_child_objects - components << ComponentSerializer::HeadingComponentSerializer.new(content: 'statutory-instruments.show.following-title', size: 3).to_h - components << ComponentSerializer::ListComponentSerializer.new(display: 'generic', display_data: [display_data(component: 'list')], components: proposed_negative_statutory_instruments).to_h - end.flatten - end - - def parent_child_objects - [].tap do |components| - components << object_heading_paragraph(3, 'statutory-instruments.show.work-package', "#{@work_package&.graph_id}") - components << object_heading_paragraph(4, 'statutory-instruments.show.procedure', "#{@procedure&.name}") - components << object_heading_paragraph(3, 'statutory-instruments.show.laying', @statutory_instrument&.laying&.graph_id) - components << object_heading_paragraph(4, 'statutory-instruments.show.laid-date', l(@statutory_instrument&.laying&.date)) - components << object_heading_paragraph(4, 'statutory-instruments.show.laying-body', @laying_body&.name) - components << object_heading_paragraph(4, 'statutory-instruments.show.laying-person', @laying_person&.display_name) - components << object_heading_paragraph(3, 'statutory-instruments.show.web-link', "#{@statutory_instrument.web_link}") - end.flatten - end - - def object_heading_paragraph(heading_size, heading_content, paragraph_content) - [].tap do |components| - components << ComponentSerializer::HeadingComponentSerializer.new(content: heading_content, size: heading_size).to_h - components << ComponentSerializer::ParagraphComponentSerializer.new(content: [{ content: paragraph_content }]).to_h - end - end - - def proposed_negative_statutory_instruments + def connected_statutory_instruments @preceding_proposed_negative_statutory_instruments.map do |stat_instrument| ComponentSerializer::LinkComponentSerializer.new( link: "/proposed-negative-statutory-instruments/#{stat_instrument.graph_id}", @@ -90,5 +58,9 @@ def proposed_negative_statutory_instruments ).to_h end end + + def connected_statutory_instruments_title + 'statutory-instruments.show.following-title' + end end end diff --git a/spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb b/spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb new file mode 100644 index 00000000..ab0b3147 --- /dev/null +++ b/spec/controllers/proposed_negative_statutory_instruments_controller_spec.rb @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +require 'rails_helper' + +RSpec.describe ProposedNegativeStatutoryInstrumentsController, vcr: true do + describe 'GET index' do + let(:data_alternates) do + [{ + :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_index.nt", + :type => "application/n-triples" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_index.ttl", + :type => "text/turtle" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_index.tsv", + :type => "text/tab-separated-values" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_index.csv", + :type => "text/csv" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_index.rj", + :type => "application/json+rdf" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_index.json", + :type => "application/json+ld" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_index.xml", + :type => "application/rdf+xml" }] + end + + before(:each) do + allow(PageSerializer::ProposedNegativeStatutoryInstrumentsIndexPageSerializer).to receive(:new) + allow(controller.request).to receive(:env).and_return({'ApplicationInsights.request.id' => '|1234abcd.'}) + + get :index + end + + it 'should have a response with http status ok (200)' do + expect(response).to have_http_status(:ok) + end + + it 'assigns @proposed_negativestatutory_instruments' do + assigns(:proposed_negative_statutory_instruments).each do |statutory_instrument| + expect(statutory_instrument).to be_a(Grom::Node) + expect(statutory_instrument.type).to include('https://id.parliament.uk/schema/ProposedNegativeStatutoryInstrumentPaper') + end + end + + it 'calls the serializer correctly' do + statutory_instruments = assigns(:proposed_negative_statutory_instruments) + + expect(PageSerializer::ProposedNegativeStatutoryInstrumentsIndexPageSerializer).to have_received(:new).with(proposed_negative_statutory_instruments: statutory_instruments, request_id: '|1234abcd.', data_alternates: data_alternates, request_original_url: request.original_url) + end + end + + describe 'GET show' do + let(:data_alternates) do + [{ + :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_by_id.nt?proposed_negative_statutory_instrument_id=12345678", + :type => "application/n-triples" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_by_id.ttl?proposed_negative_statutory_instrument_id=12345678", + :type => "text/turtle" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_by_id.tsv?proposed_negative_statutory_instrument_id=12345678", + :type => "text/tab-separated-values" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_by_id.csv?proposed_negative_statutory_instrument_id=12345678", + :type => "text/csv" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_by_id.rj?proposed_negative_statutory_instrument_id=12345678", + :type => "application/json+rdf" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_by_id.json?proposed_negative_statutory_instrument_id=12345678", + :type => "application/json+ld" }, + { :href => "#{ENV['PARLIAMENT_BASE_URL']}/proposed_negative_statutory_instrument_by_id.xml?proposed_negative_statutory_instrument_id=12345678", + :type => "application/rdf+xml" }] + end + + before(:each) do + allow(PageSerializer::ProposedNegativeStatutoryInstrumentsShowPageSerializer).to receive(:new) + allow(controller.request).to receive(:env).and_return({'ApplicationInsights.request.id' => '|1234abcd.'}) + + get :show, params: { proposed_negative_statutory_instrument_id: 12345678 } + end + + it 'should have a response with http status ok (200)' do + expect(response).to have_http_status(:ok) + end + + it 'assigns @statutory_instrument' do + expect(assigns(:proposed_negative_statutory_instrument)).to be_a(Grom::Node) + expect(assigns(:proposed_negative_statutory_instrument).type).to include('https://id.parliament.uk/schema/ProposedNegativeStatutoryInstrumentPaper') + end + + it 'calls the serializer correctly' do + statutory_instrument = assigns(:proposed_negative_statutory_instrument) + + expect(PageSerializer::ProposedNegativeStatutoryInstrumentsShowPageSerializer).to have_received(:new).with(proposed_negative_statutory_instrument: statutory_instrument, request_id: '|1234abcd.', data_alternates: data_alternates, request_original_url: request.original_url) + end + end +end diff --git a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml new file mode 100644 index 00000000..c740ebdd --- /dev/null +++ b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml @@ -0,0 +1,214 @@ +--- +layout: + template: layout +meta: + title: proposed-negative-statutory-instruments.index.title + request-id: 123456 + data-alternates: + - type: application/n-triples + href: http://localhost:3030/proposed_negative_statutory_instrument_index.nt + - type: text/turtle + href: http://localhost:3030/proposed_negative_statutory_instrument_index.ttl + - type: text/tab-separated-values + href: http://localhost:3030/proposed_negative_statutory_instrument_index.tsv + - type: text/csv + href: http://localhost:3030/proposed_negative_statutory_instrument_index.csv + - type: application/json+rdf + href: http://localhost:3030/proposed_negative_statutory_instrument_index.rj + - type: application/json+ld + href: http://localhost:3030/proposed_negative_statutory_instrument_index.json + - type: application/rdf+xml + href: http://localhost:3030/proposed_negative_statutory_instrument_index.xml + open-graph: + title: proposed-negative-statutory-instruments.index.title + original-url: http://www.example.com/proposed-negative-statutory-instruments + image-url: https://static.parliament.uk/assets-public/opengraph-oblong.png + image-width: '1200' + image-height: '630' + twitter-card: summary_large_image +header-components: +- name: link + data: + link: "#content" + display: + name: partials__display + data: + - component: skip-to-content + selector: skiplink + content: shared.header.skip-to-content +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + - component: theme + variant: caution + - component: cookie + selector: cookie + components: + - name: paragraph + data: + - content: shared.header.cookie-banner-text + data: + link: "/meta/cookie-policy" +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + components: + - name: paragraph + data: + - content: shared.header.beta-status +- name: header + data: + components: + - name: link + data: + link: "/" + display: + name: partials__display + data: + - component: uk_parliament + label: shared.header.label + components: + - name: icon__uk-parliament + data: shared.header.label +main-components: +- name: section__primary + data: + components: + - name: heading1 + data: + heading: + content: proposed-negative-statutory-instruments.index.title +- name: section__section + data: + components: + - name: list__generic + data: + type: ol + display: + name: partials__display + data: + - component: list + variant: block + components: + - name: link + data: + link: "/statutory-instruments.Tn1xqHc0" + content: proposedNegativeStatutoryInstrumentPaperName - 1 + - name: link + data: + link: "/statutory-instruments.wzsrSFQP" + content: proposedNegativeStatutoryInstrumentPaperName - 2 + - name: link + data: + link: "/statutory-instruments.H95FzZVv" + content: proposedNegativeStatutoryInstrumentPaperName - 3 + - name: link + data: + link: "/statutory-instruments.cL5yuFbG" + content: proposedNegativeStatutoryInstrumentPaperName - 4 + - name: link + data: + link: "/statutory-instruments.mssRQnqj" + content: proposedNegativeStatutoryInstrumentPaperName - 5 + - name: link + data: + link: "/statutory-instruments.PkQCvHkT" + content: proposedNegativeStatutoryInstrumentPaperName - 6 + - name: link + data: + link: "/statutory-instruments.AcoKsOuw" + content: proposedNegativeStatutoryInstrumentPaperName - 7 + - name: link + data: + link: "/statutory-instruments.zPhl1zVB" + content: proposedNegativeStatutoryInstrumentPaperName - 8 + - name: link + data: + link: "/statutory-instruments.7KgIpwmP" + content: proposedNegativeStatutoryInstrumentPaperName - 9 + - name: link + data: + link: "/statutory-instruments.YOGGjydt" + content: proposedNegativeStatutoryInstrumentPaperName - 10 + - name: link + data: + link: "/statutory-instruments.a2L0zxbo" + content: proposedNegativeStatutoryInstrumentPaperName - 11 + - name: link + data: + link: "/statutory-instruments.3XfjyKc7" + content: proposedNegativeStatutoryInstrumentPaperName - 12 + - name: link + data: + link: "/statutory-instruments.sUpfiOCM" + content: proposedNegativeStatutoryInstrumentPaperName - 13 + - name: link + data: + link: "/statutory-instruments.szRasC5x" + content: proposedNegativeStatutoryInstrumentPaperName - 14 + - name: link + data: + link: "/statutory-instruments.OtGAt1n4" + content: proposedNegativeStatutoryInstrumentPaperName - 15 + - name: link + data: + link: "/statutory-instruments.SiA85FTV" + content: proposedNegativeStatutoryInstrumentPaperName - 16 + - name: link + data: + link: "/statutory-instruments.XCCCh1kE" + content: proposedNegativeStatutoryInstrumentPaperName - 17 + - name: link + data: + link: "/statutory-instruments.78cgn2Dx" + content: proposedNegativeStatutoryInstrumentPaperName - 18 + - name: link + data: + link: "/statutory-instruments.OuKyf9Ne" + content: proposedNegativeStatutoryInstrumentPaperName - 19 + - name: link + data: + link: "/statutory-instruments.mEznEN3a" + content: proposedNegativeStatutoryInstrumentPaperName - 20 + - name: link + data: + link: "/statutory-instruments.Ykks9FXW" + content: proposedNegativeStatutoryInstrumentPaperName - 21 + - name: link + data: + link: "/statutory-instruments.W3l3iqIJ" + content: proposedNegativeStatutoryInstrumentPaperName - 22 + - name: link + data: + link: "/statutory-instruments.Xpyq1I4Q" + content: proposedNegativeStatutoryInstrumentPaperName - 23 + - name: link + data: + link: "/statutory-instruments.lTbB3os8" + content: proposedNegativeStatutoryInstrumentPaperName - 24 +footer-components: +- name: footer + data: + uk-parliament: shared.footer.uk-parliament + components: + - name: list__generic + data: + type: ul + display: + name: partials__display + data: + - component: list + contents: + - content: shared.footer.current-website + - content: shared.footer.cookie-policy + data: + link: "/meta/cookie-policy" + - content: shared.footer.data-protection-privacy diff --git a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml new file mode 100644 index 00000000..555ebe90 --- /dev/null +++ b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml @@ -0,0 +1,184 @@ +--- +layout: + template: layout +meta: + title: proposedNegativeStatutoryInstrumentPaperName - 1 + request-id: 123456 + data-alternates: + - type: application/n-triples + href: http://localhost:3030/proposed_negative_statutory_instrument_by_id.nt?proposed_negative_statutory_instrument_id=12345678 + - type: text/turtle + href: http://localhost:3030/proposed_negative_statutory_instrument_by_id.ttl?proposed_negative_statutory_instrument_id=12345678 + - type: text/tab-separated-values + href: http://localhost:3030/proposed_negative_statutory_instrument_by_id.tsv?proposed_negative_statutory_instrument_id=12345678 + - type: text/csv + href: http://localhost:3030/proposed_negative_statutory_instrument_by_id.csv?proposed_negative_statutory_instrument_id=12345678 + - type: application/json+rdf + href: http://localhost:3030/proposed_negative_statutory_instrument_by_id.rj?proposed_negative_statutory_instrument_id=12345678 + - type: application/json+ld + href: http://localhost:3030/proposed_negative_statutory_instrument_by_id.json?proposed_negative_statutory_instrument_id=12345678 + - type: application/rdf+xml + href: http://localhost:3030/proposed_negative_statutory_instrument_by_id.xml?proposed_negative_statutory_instrument_id=12345678 + open-graph: + title: proposedNegativeStatutoryInstrumentPaperName - 1 + original-url: http://www.example.com/proposed-negative-statutory-instruments/12345678 + image-url: https://static.parliament.uk/assets-public/opengraph-oblong.png + image-width: '1200' + image-height: '630' + twitter-card: summary_large_image +header-components: +- name: link + data: + link: "#content" + display: + name: partials__display + data: + - component: skip-to-content + selector: skiplink + content: shared.header.skip-to-content +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + - component: theme + variant: caution + - component: cookie + selector: cookie + components: + - name: paragraph + data: + - content: shared.header.cookie-banner-text + data: + link: "/meta/cookie-policy" +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + components: + - name: paragraph + data: + - content: shared.header.beta-status +- name: header + data: + components: + - name: link + data: + link: "/" + display: + name: partials__display + data: + - component: uk_parliament + label: shared.header.label + components: + - name: icon__uk-parliament + data: shared.header.label +main-components: +- name: section__primary + data: + components: + - name: heading1 + data: + subheading: + content: proposed-negative-statutory-instruments.show.subheading + heading: + content: proposedNegativeStatutoryInstrumentPaperName - 1 +- name: section__section + data: + components: + - name: heading + data: + content: laid-thing.objects + size: 2 + - name: heading + data: + content: laid-thing.work-package + size: 3 + - name: paragraph + data: + - content: "7xwjxL0R" + - name: heading + data: + content: laid-thing.procedure + size: 4 + - name: paragraph + data: + - content: "procedureName - 1" + - name: heading + data: + content: laid-thing.laying + size: 3 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.laid-date + size: 4 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.laying-body + size: 4 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.laying-person + size: 4 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.web-link + size: 3 + - name: paragraph + data: + - content: "https://www.gov.uk/eu-withdrawal-act-2018-statutory-instruments/the-airport-charges-amendment-eu-exit-regulations-2018" + - name: heading + data: + content: proposed-negative-statutory-instruments.show.preceding-title + size: 3 + - name: list__generic + data: + type: ol + display: + name: partials__display + data: + - component: list + components: + - name: link + data: + link: "/statutory-instruments/C1234567" + content: statutoryInstrumentPaperName - 1 + - name: link + data: + link: "/statutory-instruments/D1234567" + content: statutoryInstrumentPaperName - 2 +footer-components: +- name: footer + data: + uk-parliament: shared.footer.uk-parliament + components: + - name: list__generic + data: + type: ul + display: + name: partials__display + data: + - component: list + contents: + - content: shared.footer.current-website + - content: shared.footer.cookie-policy + data: + link: "/meta/cookie-policy" + - content: shared.footer.data-protection-privacy diff --git a/spec/fixtures/controllers/statutory_instruments_controller/show/fixture.yml b/spec/fixtures/controllers/statutory_instruments_controller/show/fixture.yml index 596ef1c4..6ba347d6 100644 --- a/spec/fixtures/controllers/statutory_instruments_controller/show/fixture.yml +++ b/spec/fixtures/controllers/statutory_instruments_controller/show/fixture.yml @@ -117,53 +117,53 @@ main-components: components: - name: heading data: - content: statutory-instruments.show.objects + content: laid-thing.objects size: 2 - name: heading data: - content: statutory-instruments.show.work-package + content: laid-thing.work-package size: 3 - name: paragraph data: - content: "zhi6ZHnQ" - name: heading data: - content: statutory-instruments.show.procedure + content: laid-thing.procedure size: 4 - name: paragraph data: - content: "procedureName - 1" - name: heading data: - content: statutory-instruments.show.laying + content: laid-thing.laying size: 3 - name: paragraph data: - content: 2iDuQtrK - name: heading data: - content: statutory-instruments.show.laid-date + content: laid-thing.laid-date size: 4 - name: paragraph data: - content: 1 May 2018 - name: heading data: - content: statutory-instruments.show.laying-body + content: laid-thing.laying-body size: 4 - name: paragraph data: - content: groupName - 1 - name: heading data: - content: statutory-instruments.show.laying-person + content: laid-thing.laying-person size: 4 - name: paragraph data: - content: F31CBD81AD8343898B49DC65743F0BDF - 1 - name: heading data: - content: statutory-instruments.show.web-link + content: laid-thing.web-link size: 3 - name: paragraph data: diff --git a/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml new file mode 100644 index 00000000..26414a6c --- /dev/null +++ b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml @@ -0,0 +1,84 @@ +--- +layout: + template: layout +meta: + title: + data-alternates: + open-graph: + title: + original-url: + image-url: https://static.parliament.uk/assets-public/opengraph-oblong.png + image-width: '1200' + image-height: '630' + twitter-card: summary_large_image +header-components: +- name: link + data: + link: "#content" + display: + name: partials__display + data: + - component: skip-to-content + selector: skiplink + content: shared.header.skip-to-content +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + - component: theme + variant: caution + - component: cookie + selector: cookie + components: + - name: paragraph + data: + - content: shared.header.cookie-banner-text + data: + link: "/meta/cookie-policy" +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + components: + - name: paragraph + data: + - content: shared.header.beta-status +- name: header + data: + components: + - name: link + data: + link: "/" + display: + name: partials__display + data: + - component: uk_parliament + label: shared.header.label + components: + - name: icon__uk-parliament + data: shared.header.label +main-components: +footer-components: +- name: footer + data: + uk-parliament: shared.footer.uk-parliament + components: + - name: list__generic + data: + type: ul + display: + name: partials__display + data: + - component: list + contents: + - content: shared.footer.current-website + - content: shared.footer.cookie-policy + data: + link: "/meta/cookie-policy" + - content: shared.footer.data-protection-privacy diff --git a/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml new file mode 100644 index 00000000..26414a6c --- /dev/null +++ b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml @@ -0,0 +1,84 @@ +--- +layout: + template: layout +meta: + title: + data-alternates: + open-graph: + title: + original-url: + image-url: https://static.parliament.uk/assets-public/opengraph-oblong.png + image-width: '1200' + image-height: '630' + twitter-card: summary_large_image +header-components: +- name: link + data: + link: "#content" + display: + name: partials__display + data: + - component: skip-to-content + selector: skiplink + content: shared.header.skip-to-content +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + - component: theme + variant: caution + - component: cookie + selector: cookie + components: + - name: paragraph + data: + - content: shared.header.cookie-banner-text + data: + link: "/meta/cookie-policy" +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + components: + - name: paragraph + data: + - content: shared.header.beta-status +- name: header + data: + components: + - name: link + data: + link: "/" + display: + name: partials__display + data: + - component: uk_parliament + label: shared.header.label + components: + - name: icon__uk-parliament + data: shared.header.label +main-components: +footer-components: +- name: footer + data: + uk-parliament: shared.footer.uk-parliament + components: + - name: list__generic + data: + type: ul + display: + name: partials__display + data: + - component: list + contents: + - content: shared.footer.current-website + - content: shared.footer.cookie-policy + data: + link: "/meta/cookie-policy" + - content: shared.footer.data-protection-privacy diff --git a/spec/fixtures/serializers/page_serializer/list_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/list_page_serializer/fixture.yml new file mode 100644 index 00000000..e69de29b diff --git a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml new file mode 100644 index 00000000..80672142 --- /dev/null +++ b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml @@ -0,0 +1,111 @@ +--- +layout: + template: layout +meta: + title: proposed-negative-statutory-instruments.index.title + data-alternates: + open-graph: + title: proposed-negative-statutory-instruments.index.title + original-url: + image-url: https://static.parliament.uk/assets-public/opengraph-oblong.png + image-width: '1200' + image-height: '630' + twitter-card: summary_large_image +header-components: +- name: link + data: + link: "#content" + display: + name: partials__display + data: + - component: skip-to-content + selector: skiplink + content: shared.header.skip-to-content +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + - component: theme + variant: caution + - component: cookie + selector: cookie + components: + - name: paragraph + data: + - content: shared.header.cookie-banner-text + data: + link: "/meta/cookie-policy" +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + components: + - name: paragraph + data: + - content: shared.header.beta-status +- name: header + data: + components: + - name: link + data: + link: "/" + display: + name: partials__display + data: + - component: uk_parliament + label: shared.header.label + components: + - name: icon__uk-parliament + data: shared.header.label +main-components: +- name: section__primary + data: + components: + - name: heading1 + data: + heading: + content: proposed-negative-statutory-instruments.index.title +- name: section__section + data: + components: + - name: list__generic + data: + type: ol + display: + name: partials__display + data: + - component: list + variant: block + components: + - name: link + data: + link: "/statutory-instruments.A1234567" + content: SI Paper A + - name: link + data: + link: "/statutory-instruments.B1234567" + content: SI Paper B +footer-components: +- name: footer + data: + uk-parliament: shared.footer.uk-parliament + components: + - name: list__generic + data: + type: ul + display: + name: partials__display + data: + - component: list + contents: + - content: shared.footer.current-website + - content: shared.footer.cookie-policy + data: + link: "/meta/cookie-policy" + - content: shared.footer.data-protection-privacy diff --git a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml new file mode 100644 index 00000000..ff5f9941 --- /dev/null +++ b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml @@ -0,0 +1,169 @@ +--- +layout: + template: layout +meta: + title: Proposed Negative SI Paper Test + data-alternates: + open-graph: + title: Proposed Negative SI Paper Test + original-url: + image-url: https://static.parliament.uk/assets-public/opengraph-oblong.png + image-width: '1200' + image-height: '630' + twitter-card: summary_large_image +header-components: +- name: link + data: + link: "#content" + display: + name: partials__display + data: + - component: skip-to-content + selector: skiplink + content: shared.header.skip-to-content +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + - component: theme + variant: caution + - component: cookie + selector: cookie + components: + - name: paragraph + data: + - content: shared.header.cookie-banner-text + data: + link: "/meta/cookie-policy" +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + components: + - name: paragraph + data: + - content: shared.header.beta-status +- name: header + data: + components: + - name: link + data: + link: "/" + display: + name: partials__display + data: + - component: uk_parliament + label: shared.header.label + components: + - name: icon__uk-parliament + data: shared.header.label +main-components: +- name: section__primary + data: + components: + - name: heading1 + data: + subheading: + content: proposed-negative-statutory-instruments.show.subheading + heading: + content: Proposed Negative SI Paper Test +- name: section__section + data: + components: + - name: heading + data: + content: laid-thing.objects + size: 2 + - name: heading + data: + content: laid-thing.work-package + size: 3 + - name: paragraph + data: + - content: "C1234567" + - name: heading + data: + content: laid-thing.procedure + size: 4 + - name: paragraph + data: + - content: "ProcedureTest" + - name: heading + data: + content: laid-thing.laying + size: 3 + - name: paragraph + data: + - content: G1234567 + - name: heading + data: + content: laid-thing.laid-date + size: 4 + - name: paragraph + data: + - content: 10 August 2018 + - name: heading + data: + content: laid-thing.laying-body + size: 4 + - name: paragraph + data: + - content: LayingBodyTest + - name: heading + data: + content: laid-thing.laying-person + size: 4 + - name: paragraph + data: + - content: LayingPersonTest + - name: heading + data: + content: laid-thing.web-link + size: 3 + - name: paragraph + data: + - content: "http://example.com" + - name: heading + data: + content: proposed-negative-statutory-instruments.show.preceding-title + size: 3 + - name: list__generic + data: + type: ol + display: + name: partials__display + data: + - component: list + components: + - name: link + data: + link: "/statutory-instruments/A1234567" + content: SIPaperA + - name: link + data: + link: "/statutory-instruments/B1234567" + content: SIPaperB +footer-components: +- name: footer + data: + uk-parliament: shared.footer.uk-parliament + components: + - name: list__generic + data: + type: ul + display: + name: partials__display + data: + - component: list + contents: + - content: shared.footer.current-website + - content: shared.footer.cookie-policy + data: + link: "/meta/cookie-policy" + - content: shared.footer.data-protection-privacy diff --git a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml new file mode 100644 index 00000000..c5e62031 --- /dev/null +++ b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml @@ -0,0 +1,161 @@ +--- +layout: + template: layout +meta: + title: SI Paper Test + data-alternates: + open-graph: + title: SI Paper Test + original-url: + image-url: https://static.parliament.uk/assets-public/opengraph-oblong.png + image-width: '1200' + image-height: '630' + twitter-card: summary_large_image +header-components: +- name: link + data: + link: "#content" + display: + name: partials__display + data: + - component: skip-to-content + selector: skiplink + content: shared.header.skip-to-content +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + - component: theme + variant: caution + - component: cookie + selector: cookie + components: + - name: paragraph + data: + - content: shared.header.cookie-banner-text + data: + link: "/meta/cookie-policy" +- name: status__banner + data: + display: + name: partials__display + data: + - component: status + variant: banner + components: + - name: paragraph + data: + - content: shared.header.beta-status +- name: header + data: + components: + - name: link + data: + link: "/" + display: + name: partials__display + data: + - component: uk_parliament + label: shared.header.label + components: + - name: icon__uk-parliament + data: shared.header.label +main-components: +- name: section__primary + data: + components: + - name: heading1 + data: + subheading: + content: proposed-negative-statutory-instruments.show.subheading + heading: + content: SI Paper Test +- name: section__section + data: + components: + - name: heading + data: + content: laid-thing.objects + size: 2 + - name: heading + data: + content: laid-thing.work-package + size: 3 + - name: paragraph + data: + - content: "" + - name: heading + data: + content: laid-thing.procedure + size: 4 + - name: paragraph + data: + - content: "" + - name: heading + data: + content: laid-thing.laying + size: 3 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.laid-date + size: 4 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.laying-body + size: 4 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.laying-person + size: 4 + - name: paragraph + data: + - content: + - name: heading + data: + content: laid-thing.web-link + size: 3 + - name: paragraph + data: + - content: "" + - name: heading + data: + content: proposed-negative-statutory-instruments.show.preceding-title + size: 3 + - name: list__generic + data: + type: ol + display: + name: partials__display + data: + - component: list + components: [] +footer-components: +- name: footer + data: + uk-parliament: shared.footer.uk-parliament + components: + - name: list__generic + data: + type: ul + display: + name: partials__display + data: + - component: list + contents: + - content: shared.footer.current-website + - content: shared.footer.cookie-policy + data: + link: "/meta/cookie-policy" + - content: shared.footer.data-protection-privacy diff --git a/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/fixture.yml index dddc00f2..9ce5d1b8 100644 --- a/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/fixture.yml +++ b/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/fixture.yml @@ -109,53 +109,53 @@ main-components: components: - name: heading data: - content: statutory-instruments.show.objects + content: laid-thing.objects size: 2 - name: heading data: - content: statutory-instruments.show.work-package + content: laid-thing.work-package size: 3 - name: paragraph data: - content: "C1234567" - name: heading data: - content: statutory-instruments.show.procedure + content: laid-thing.procedure size: 4 - name: paragraph data: - content: "ProcedureTest" - name: heading data: - content: statutory-instruments.show.laying + content: laid-thing.laying size: 3 - name: paragraph data: - content: G1234567 - name: heading data: - content: statutory-instruments.show.laid-date + content: laid-thing.laid-date size: 4 - name: paragraph data: - content: 10 August 2018 - name: heading data: - content: statutory-instruments.show.laying-body + content: laid-thing.laying-body size: 4 - name: paragraph data: - content: LayingBodyTest - name: heading data: - content: statutory-instruments.show.laying-person + content: laid-thing.laying-person size: 4 - name: paragraph data: - content: LayingPersonTest - name: heading data: - content: statutory-instruments.show.web-link + content: laid-thing.web-link size: 3 - name: paragraph data: diff --git a/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/si_missing_data.yml b/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/si_missing_data.yml index 184f277e..e7c304bf 100644 --- a/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/si_missing_data.yml +++ b/spec/fixtures/serializers/page_serializer/statutory_instruments_show_page_serializer/si_missing_data.yml @@ -101,53 +101,53 @@ main-components: components: - name: heading data: - content: statutory-instruments.show.objects + content: laid-thing.objects size: 2 - name: heading data: - content: statutory-instruments.show.work-package + content: laid-thing.work-package size: 3 - name: paragraph data: - content: "" - name: heading data: - content: statutory-instruments.show.procedure + content: laid-thing.procedure size: 4 - name: paragraph data: - content: "" - name: heading data: - content: statutory-instruments.show.laying + content: laid-thing.laying size: 3 - name: paragraph data: - content: - name: heading data: - content: statutory-instruments.show.laid-date + content: laid-thing.laid-date size: 4 - name: paragraph data: - content: - name: heading data: - content: statutory-instruments.show.laying-body + content: laid-thing.laying-body size: 4 - name: paragraph data: - content: - name: heading data: - content: statutory-instruments.show.laying-person + content: laid-thing.laying-person size: 4 - name: paragraph data: - content: - name: heading data: - content: statutory-instruments.show.web-link + content: laid-thing.web-link size: 3 - name: paragraph data: diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/assigns_proposed_negativestatutory_instruments.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/assigns_proposed_negativestatutory_instruments.yml new file mode 100644 index 00000000..dba36829 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/assigns_proposed_negativestatutory_instruments.yml @@ -0,0 +1,111 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_index + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Fri, 31 Aug 2018 08:31:29 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '11798' + body: + encoding: UTF-8 + string: | + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 2" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 3" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 4" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 5" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 6" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 7" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 8" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 9" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 10" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 11" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 12" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 13" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 14" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 15" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 16" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 17" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 18" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 19" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 20" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 21" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 22" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 23" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 24" . + http_version: + recorded_at: Tue, 18 Sep 2018 08:42:48 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/calls_the_serializer_correctly.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/calls_the_serializer_correctly.yml new file mode 100644 index 00000000..dba36829 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/calls_the_serializer_correctly.yml @@ -0,0 +1,111 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_index + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Fri, 31 Aug 2018 08:31:29 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '11798' + body: + encoding: UTF-8 + string: | + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 2" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 3" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 4" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 5" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 6" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 7" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 8" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 9" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 10" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 11" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 12" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 13" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 14" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 15" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 16" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 17" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 18" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 19" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 20" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 21" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 22" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 23" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 24" . + http_version: + recorded_at: Tue, 18 Sep 2018 08:42:48 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/navigating_to_the_index_page/renders_expected_JSON_output.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/navigating_to_the_index_page/renders_expected_JSON_output.yml new file mode 100644 index 00000000..5e7e8973 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/navigating_to_the_index_page/renders_expected_JSON_output.yml @@ -0,0 +1,111 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_index + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Fri, 31 Aug 2018 08:31:29 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '11798' + body: + encoding: UTF-8 + string: | + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 2" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 3" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 4" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 5" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 6" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 7" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 8" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 9" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 10" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 11" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 12" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 13" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 14" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 15" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 16" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 17" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 18" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 19" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 20" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 21" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 22" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 23" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 24" . + http_version: + recorded_at: Tue, 18 Sep 2018 09:09:52 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/should_have_a_response_with_http_status_ok_200_.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/should_have_a_response_with_http_status_ok_200_.yml new file mode 100644 index 00000000..dba36829 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_index/should_have_a_response_with_http_status_ok_200_.yml @@ -0,0 +1,111 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_index + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Fri, 31 Aug 2018 08:31:29 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '11798' + body: + encoding: UTF-8 + string: | + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 2" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 3" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 4" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 5" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 6" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 7" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 8" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 9" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 10" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 11" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 12" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 13" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 14" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 15" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 16" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 17" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 18" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 19" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 20" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 21" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 22" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 23" . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 24" . + http_version: + recorded_at: Tue, 18 Sep 2018 08:42:48 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/assigns_statutory_instrument.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/assigns_statutory_instrument.yml new file mode 100644 index 00000000..3a56be67 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/assigns_statutory_instrument.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_by_id?proposed_negative_statutory_instrument_id=12345678 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Thu, 13 Sep 2018 14:03:41 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '2422' + body: + encoding: UTF-8 + string: | + . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + . + . + . + "procedureName - 1" . + + . + . + . + . + "statutoryInstrumentPaperName - 1" . + "statutoryInstrumentPaperName - 2" . + http_version: + recorded_at: Tue, 18 Sep 2018 08:42:48 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/calls_the_serializer_correctly.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/calls_the_serializer_correctly.yml new file mode 100644 index 00000000..3a56be67 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/calls_the_serializer_correctly.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_by_id?proposed_negative_statutory_instrument_id=12345678 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Thu, 13 Sep 2018 14:03:41 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '2422' + body: + encoding: UTF-8 + string: | + . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + . + . + . + "procedureName - 1" . + + . + . + . + . + "statutoryInstrumentPaperName - 1" . + "statutoryInstrumentPaperName - 2" . + http_version: + recorded_at: Tue, 18 Sep 2018 08:42:48 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/navigating_to_the_show_page/renders_expected_JSON_output.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/navigating_to_the_show_page/renders_expected_JSON_output.yml new file mode 100644 index 00000000..88b5ac5b --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/navigating_to_the_show_page/renders_expected_JSON_output.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_by_id?proposed_negative_statutory_instrument_id=12345678 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Thu, 13 Sep 2018 14:03:41 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '2422' + body: + encoding: UTF-8 + string: | + . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + . + . + . + "procedureName - 1" . + + . + . + . + . + "statutoryInstrumentPaperName - 1" . + "statutoryInstrumentPaperName - 2" . + http_version: + recorded_at: Tue, 18 Sep 2018 08:42:45 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/should_have_a_response_with_http_status_ok_200_.yml b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/should_have_a_response_with_http_status_ok_200_.yml new file mode 100644 index 00000000..3a56be67 --- /dev/null +++ b/spec/fixtures/vcr_cassettes/ProposedNegativeStatutoryInstrumentsController/GET_show/should_have_a_response_with_http_status_ok_200_.yml @@ -0,0 +1,56 @@ +--- +http_interactions: +- request: + method: get + uri: http://localhost:3030/proposed_negative_statutory_instrument_by_id?proposed_negative_statutory_instrument_id=12345678 + body: + encoding: US-ASCII + string: '' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + - application/n-triples + User-Agent: + - Ruby + Ocp-Apim-Subscription-Key: + - "" + response: + status: + code: 200 + message: OK + headers: + Content-Type: + - application/n-triples + Content-Disposition: + - inline; filename="index" + Last-Modified: + - Thu, 13 Sep 2018 14:03:41 GMT + X-Content-Type-Options: + - nosniff + Content-Length: + - '2422' + body: + encoding: UTF-8 + string: | + . + . + . + "proposedNegativeStatutoryInstrumentPaperName - 1" . + . + . + . + . + . + "procedureName - 1" . + + . + . + . + . + "statutoryInstrumentPaperName - 1" . + "statutoryInstrumentPaperName - 2" . + http_version: + recorded_at: Tue, 18 Sep 2018 08:42:48 GMT +recorded_with: VCR 4.0.0 diff --git a/spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb b/spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb new file mode 100644 index 00000000..465823d3 --- /dev/null +++ b/spec/integration/controllers/proposed_negative_statutory_instruments_controller_spec.rb @@ -0,0 +1,37 @@ +require_relative '../../rails_helper' + +RSpec.describe ProposedNegativeStatutoryInstrumentsController, vcr: true do + describe 'GET index' do + before(:each) do + allow_any_instance_of(ProposedNegativeStatutoryInstrumentsController).to receive(:app_insights_request_id) { 123456 } + end + + context 'navigating to the index page' do + it 'renders expected JSON output' do + get '/proposed-negative-statutory-instruments' + filtered_response_body = filter_sensitive_data(response.body) + + expected_json = get_fixture('index', 'fixture') + + expect(JSON.parse(filtered_response_body).to_yaml).to eq(expected_json) + end + end + end + + describe 'GET show' do + before(:each) do + allow_any_instance_of(ProposedNegativeStatutoryInstrumentsController).to receive(:app_insights_request_id) { 123456 } + end + + context 'navigating to the show page' do + it 'renders expected JSON output' do + get '/proposed-negative-statutory-instruments/12345678' + filtered_response_body = filter_sensitive_data(response.body) + + expected_json = get_fixture('show', 'fixture') + + expect(JSON.parse(filtered_response_body).to_yaml).to eq(expected_json) + end + end + end +end diff --git a/spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb b/spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb new file mode 100644 index 00000000..d453dd81 --- /dev/null +++ b/spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb @@ -0,0 +1,47 @@ +require_relative '../../rails_helper' + +RSpec.describe PageSerializer::LaidThingShowPageSerializer do + let(:laying_body) { double('laying_body', name: 'LayingBodyTest', graph_id: 'E1234567') } + let(:laying_person) { double('laying_person', display_name: 'LayingPersonTest', graph_id: 'F1234567') } + let(:laying) { double('laying', body: laying_body, person: laying_person, date: DateTime.new(2018, 8, 10, 0, 0), graph_id: 'G1234567') } + let(:procedure) { double('procedure', name: 'ProcedureTest', graph_id: 'D1234567') } + let(:work_package) { double('work_package', name: 'WorkPackageTest', graph_id: 'C1234567', procedure: procedure) } + + let(:laid_thing) do + double('laid_thing', + web_link: 'http://example.com', + laying: laying, + work_package: work_package + ) + end + + let(:subject) { described_class.new(laid_thing: laid_thing) } + + context '#to_h' do + it 'produces the expected JSON hash' do + + expected = get_fixture('fixture') + + expect(subject.to_yaml).to eq expected + end + end + + context 'partial data' do + let(:laid_thing_missing_data) do + double('laid_thing_missing_data', + web_link: '', + laying: nil, + work_package: nil + ) + end + + it 'produces the expected JSON hash with missing data' do + serializer = described_class.new(laid_thing: laid_thing_missing_data) + + expected = get_fixture('laid_thing_missing_data') + + expect(serializer.to_yaml).to eq expected + end + end +end + diff --git a/spec/serializers/page_serializer/list_page_serializer_spec.rb b/spec/serializers/page_serializer/list_page_serializer_spec.rb new file mode 100644 index 00000000..12122bc3 --- /dev/null +++ b/spec/serializers/page_serializer/list_page_serializer_spec.rb @@ -0,0 +1,51 @@ +require_relative '../../rails_helper' + +RSpec.describe PageSerializer::ListPageSerializer do + let(:subject) { described_class.new(page_title: 'Test page') } + + context 'the serializers are correctly called' do + context '#content' do + before(:each) do + allow(ComponentSerializer::SectionComponentSerializer).to receive(:new) + + allow(subject).to receive(:section_primary_components) { [] } + allow(subject).to receive(:section_components) { [] } + end + + it 'receives the correct serializers' do + subject.to_h + + expect(ComponentSerializer::SectionComponentSerializer).to have_received(:new).with([], type: 'primary') + expect(ComponentSerializer::SectionComponentSerializer).to have_received(:new).with([], type: 'section') + end + end + end + + context '#section_primary_components' do + it 'calls the correct components' do + allow(ComponentSerializer::Heading1ComponentSerializer).to receive(:new) + + subject.send(:section_primary_components) + + expect(ComponentSerializer::Heading1ComponentSerializer).to have_received(:new).with(heading_content: 'Test page') + end + end + + + context '#section_components' do + it 'calls the correct components' do + allow(ComponentSerializer::ListComponentSerializer).to receive(:new) + allow(subject).to receive(:list_components).and_return([]) + + subject.send(:section_components) + + expect(ComponentSerializer::ListComponentSerializer).to have_received(:new).with(display: 'generic', display_data: [{:component => 'list', :variant => 'block' }], components: []) + end + end + + context 'raising errors' do + it '#list_components' do + expect{ subject.send(:list_components) }.to raise_error StandardError, 'You must implement #list_components' + end + end +end diff --git a/spec/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer_spec.rb b/spec/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer_spec.rb new file mode 100644 index 00000000..0ab7a1aa --- /dev/null +++ b/spec/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer_spec.rb @@ -0,0 +1,18 @@ +require_relative '../../rails_helper' + +RSpec.describe PageSerializer::ProposedNegativeStatutoryInstrumentsIndexPageSerializer do + let(:statutory_instrument_a) { double('statutory_instrument_a', name: 'SI Paper A', graph_id: 'A1234567') } + let(:statutory_instrument_b) { double('statutory_instrument_b', name: 'SI Paper B', graph_id: 'B1234567') } + let(:statutory_instruments) { [statutory_instrument_a, statutory_instrument_b] } + + let(:subject) { described_class.new(proposed_negative_statutory_instruments: statutory_instruments) } + + context '#to_h' do + it 'produces the expected JSON hash' do + + expected = get_fixture('fixture') + + expect(subject.to_yaml).to eq expected + end + end +end diff --git a/spec/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer_spec.rb b/spec/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer_spec.rb new file mode 100644 index 00000000..6b6b5d38 --- /dev/null +++ b/spec/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer_spec.rb @@ -0,0 +1,53 @@ +require_relative '../../rails_helper' + +RSpec.describe PageSerializer::ProposedNegativeStatutoryInstrumentsShowPageSerializer do + let(:laying_body) { double('laying_body', name: 'LayingBodyTest', graph_id: 'E1234567') } + let(:laying_person) { double('laying_person', display_name: 'LayingPersonTest', graph_id: 'F1234567') } + let(:laying) { double('laying', body: laying_body, person: laying_person, date: DateTime.new(2018, 8, 10, 0, 0), graph_id: 'G1234567') } + let(:procedure) { double('procedure', name: 'ProcedureTest', graph_id: 'D1234567') } + let(:work_package) { double('work_package', name: 'WorkPackageTest', graph_id: 'C1234567', procedure: procedure) } + let(:stat_instrument_a) { double('stat_instrument_a', name: 'SIPaperA', graph_id: 'A1234567') } + let(:stat_instrument_b) { double('stat_instrument_b', name: 'SIPaperB', graph_id: 'B1234567') } + + let(:proposed_negative_statutory_instrument) do + double('proposed_negative_statutory_instrument', + name: 'Proposed Negative SI Paper Test', + web_link: 'http://example.com', + laying: laying, + work_package: work_package, + statutory_instrument_papers: [stat_instrument_a, stat_instrument_b] + ) + end + + let(:subject) { described_class.new(proposed_negative_statutory_instrument: proposed_negative_statutory_instrument) } + + context '#to_h' do + it 'produces the expected JSON hash' do + + expected = get_fixture('fixture') + + expect(subject.to_yaml).to eq expected + end + end + + context 'partial data' do + let(:si_missing_data) do + double('si_missing_data', + name: 'SI Paper Test', + web_link: '', + laying: nil, + work_package: nil, + statutory_instrument_papers: [] + ) + end + + it 'produces the expected JSON hash with missing data' do + serializer = described_class.new(proposed_negative_statutory_instrument: si_missing_data) + + expected = get_fixture('si_missing_data') + + expect(serializer.to_yaml).to eq expected + end + end +end + From 17c3fbf03e4a4c7a447e48f12afaadda2de78986 Mon Sep 17 00:00:00 2001 From: Rebecca Appleyard Date: Tue, 18 Sep 2018 13:35:49 +0100 Subject: [PATCH 2/3] Fixed links on index pages --- ...utory_instruments_index_page_serializer.rb | 2 +- ...utory_instruments_index_page_serializer.rb | 2 +- .../index/fixture.yml | 48 +- .../index/fixture.yml | 472 +++++++++--------- .../fixture.yml | 4 +- .../fixture.yml | 4 +- 6 files changed, 266 insertions(+), 266 deletions(-) diff --git a/app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb b/app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb index 28f73486..b9db3430 100644 --- a/app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb +++ b/app/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer.rb @@ -18,7 +18,7 @@ def initialize(proposed_negative_statutory_instruments:, request_id: nil, data_a def list_components @proposed_negative_statutory_instruments.map do |statutory_instrument| - ComponentSerializer::LinkComponentSerializer.new(link: statutory_instruments_path(statutory_instrument.graph_id), content: statutory_instrument.name).to_h + ComponentSerializer::LinkComponentSerializer.new(link: "proposed-negative-statutory-instruments/#{statutory_instrument.graph_id}", content: statutory_instrument.name).to_h end end end diff --git a/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb b/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb index f3ad7490..24658bf5 100644 --- a/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb +++ b/app/serializers/page_serializer/statutory_instruments_index_page_serializer.rb @@ -18,7 +18,7 @@ def initialize(statutory_instruments:, request_id: nil, data_alternates: nil, re def list_components @statutory_instruments.map do |statutory_instrument| - ComponentSerializer::LinkComponentSerializer.new(link: statutory_instruments_path(statutory_instrument.graph_id), content: statutory_instrument.name).to_h + ComponentSerializer::LinkComponentSerializer.new(link: "statutory-instruments/#{statutory_instrument.graph_id}", content: statutory_instrument.name).to_h end end end diff --git a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml index c740ebdd..de50062a 100644 --- a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml +++ b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml @@ -100,99 +100,99 @@ main-components: components: - name: link data: - link: "/statutory-instruments.Tn1xqHc0" + link: proposed-negative-statutory-instruments/Tn1xqHc0 content: proposedNegativeStatutoryInstrumentPaperName - 1 - name: link data: - link: "/statutory-instruments.wzsrSFQP" + link: proposed-negative-statutory-instruments/wzsrSFQP content: proposedNegativeStatutoryInstrumentPaperName - 2 - name: link data: - link: "/statutory-instruments.H95FzZVv" + link: proposed-negative-statutory-instruments/H95FzZVv content: proposedNegativeStatutoryInstrumentPaperName - 3 - name: link data: - link: "/statutory-instruments.cL5yuFbG" + link: proposed-negative-statutory-instruments/cL5yuFbG content: proposedNegativeStatutoryInstrumentPaperName - 4 - name: link data: - link: "/statutory-instruments.mssRQnqj" + link: proposed-negative-statutory-instruments/mssRQnqj content: proposedNegativeStatutoryInstrumentPaperName - 5 - name: link data: - link: "/statutory-instruments.PkQCvHkT" + link: proposed-negative-statutory-instruments/PkQCvHkT content: proposedNegativeStatutoryInstrumentPaperName - 6 - name: link data: - link: "/statutory-instruments.AcoKsOuw" + link: proposed-negative-statutory-instruments/AcoKsOuw content: proposedNegativeStatutoryInstrumentPaperName - 7 - name: link data: - link: "/statutory-instruments.zPhl1zVB" + link: proposed-negative-statutory-instruments/zPhl1zVB content: proposedNegativeStatutoryInstrumentPaperName - 8 - name: link data: - link: "/statutory-instruments.7KgIpwmP" + link: proposed-negative-statutory-instruments/7KgIpwmP content: proposedNegativeStatutoryInstrumentPaperName - 9 - name: link data: - link: "/statutory-instruments.YOGGjydt" + link: proposed-negative-statutory-instruments/YOGGjydt content: proposedNegativeStatutoryInstrumentPaperName - 10 - name: link data: - link: "/statutory-instruments.a2L0zxbo" + link: proposed-negative-statutory-instruments/a2L0zxbo content: proposedNegativeStatutoryInstrumentPaperName - 11 - name: link data: - link: "/statutory-instruments.3XfjyKc7" + link: proposed-negative-statutory-instruments/3XfjyKc7 content: proposedNegativeStatutoryInstrumentPaperName - 12 - name: link data: - link: "/statutory-instruments.sUpfiOCM" + link: proposed-negative-statutory-instruments/sUpfiOCM content: proposedNegativeStatutoryInstrumentPaperName - 13 - name: link data: - link: "/statutory-instruments.szRasC5x" + link: proposed-negative-statutory-instruments/szRasC5x content: proposedNegativeStatutoryInstrumentPaperName - 14 - name: link data: - link: "/statutory-instruments.OtGAt1n4" + link: proposed-negative-statutory-instruments/OtGAt1n4 content: proposedNegativeStatutoryInstrumentPaperName - 15 - name: link data: - link: "/statutory-instruments.SiA85FTV" + link: proposed-negative-statutory-instruments/SiA85FTV content: proposedNegativeStatutoryInstrumentPaperName - 16 - name: link data: - link: "/statutory-instruments.XCCCh1kE" + link: proposed-negative-statutory-instruments/XCCCh1kE content: proposedNegativeStatutoryInstrumentPaperName - 17 - name: link data: - link: "/statutory-instruments.78cgn2Dx" + link: proposed-negative-statutory-instruments/78cgn2Dx content: proposedNegativeStatutoryInstrumentPaperName - 18 - name: link data: - link: "/statutory-instruments.OuKyf9Ne" + link: proposed-negative-statutory-instruments/OuKyf9Ne content: proposedNegativeStatutoryInstrumentPaperName - 19 - name: link data: - link: "/statutory-instruments.mEznEN3a" + link: proposed-negative-statutory-instruments/mEznEN3a content: proposedNegativeStatutoryInstrumentPaperName - 20 - name: link data: - link: "/statutory-instruments.Ykks9FXW" + link: proposed-negative-statutory-instruments/Ykks9FXW content: proposedNegativeStatutoryInstrumentPaperName - 21 - name: link data: - link: "/statutory-instruments.W3l3iqIJ" + link: proposed-negative-statutory-instruments/W3l3iqIJ content: proposedNegativeStatutoryInstrumentPaperName - 22 - name: link data: - link: "/statutory-instruments.Xpyq1I4Q" + link: proposed-negative-statutory-instruments/Xpyq1I4Q content: proposedNegativeStatutoryInstrumentPaperName - 23 - name: link data: - link: "/statutory-instruments.lTbB3os8" + link: proposed-negative-statutory-instruments/lTbB3os8 content: proposedNegativeStatutoryInstrumentPaperName - 24 footer-components: - name: footer diff --git a/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml b/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml index 86a5033d..97773920 100644 --- a/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml +++ b/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml @@ -107,943 +107,943 @@ main-components: components: - name: link data: - link: "/statutory-instruments.5trFJNih" + link: statutory-instruments/5trFJNih content: statutoryInstrumentPaperName - 1 - name: link data: - link: "/statutory-instruments.VIqyNL58" + link: statutory-instruments/VIqyNL58 content: statutoryInstrumentPaperName - 2 - name: link data: - link: "/statutory-instruments.LFLdzMuO" + link: statutory-instruments/LFLdzMuO content: statutoryInstrumentPaperName - 3 - name: link data: - link: "/statutory-instruments.TKqREWHZ" + link: statutory-instruments/TKqREWHZ content: statutoryInstrumentPaperName - 4 - name: link data: - link: "/statutory-instruments.QV9rpep6" + link: statutory-instruments/QV9rpep6 content: statutoryInstrumentPaperName - 5 - name: link data: - link: "/statutory-instruments.GOOyVBR4" + link: statutory-instruments/GOOyVBR4 content: statutoryInstrumentPaperName - 6 - name: link data: - link: "/statutory-instruments.KZpExrdI" + link: statutory-instruments/KZpExrdI content: statutoryInstrumentPaperName - 7 - name: link data: - link: "/statutory-instruments.tjxWFlR2" + link: statutory-instruments/tjxWFlR2 content: statutoryInstrumentPaperName - 8 - name: link data: - link: "/statutory-instruments.PqyD6lfd" + link: statutory-instruments/PqyD6lfd content: statutoryInstrumentPaperName - 9 - name: link data: - link: "/statutory-instruments.Tw34pUb3" + link: statutory-instruments/Tw34pUb3 content: statutoryInstrumentPaperName - 10 - name: link data: - link: "/statutory-instruments.e1nEbjRI" + link: statutory-instruments/e1nEbjRI content: statutoryInstrumentPaperName - 11 - name: link data: - link: "/statutory-instruments.FCcBOrUo" + link: statutory-instruments/FCcBOrUo content: statutoryInstrumentPaperName - 12 - name: link data: - link: "/statutory-instruments.1fStCnaK" + link: statutory-instruments/1fStCnaK content: statutoryInstrumentPaperName - 13 - name: link data: - link: "/statutory-instruments.tPkKG8ef" + link: statutory-instruments/tPkKG8ef content: statutoryInstrumentPaperName - 14 - name: link data: - link: "/statutory-instruments.uNiGNHey" + link: statutory-instruments/uNiGNHey content: statutoryInstrumentPaperName - 15 - name: link data: - link: "/statutory-instruments.9PfnbabC" + link: statutory-instruments/9PfnbabC content: statutoryInstrumentPaperName - 16 - name: link data: - link: "/statutory-instruments.yxN0RDlj" + link: statutory-instruments/yxN0RDlj content: statutoryInstrumentPaperName - 17 - name: link data: - link: "/statutory-instruments.keUmDe6y" + link: statutory-instruments/keUmDe6y content: statutoryInstrumentPaperName - 18 - name: link data: - link: "/statutory-instruments.HJ7BlYte" + link: statutory-instruments/HJ7BlYte content: statutoryInstrumentPaperName - 19 - name: link data: - link: "/statutory-instruments.i9hQEgyv" + link: statutory-instruments/i9hQEgyv content: statutoryInstrumentPaperName - 20 - name: link data: - link: "/statutory-instruments.O8GS8jnH" + link: statutory-instruments/O8GS8jnH content: statutoryInstrumentPaperName - 21 - name: link data: - link: "/statutory-instruments.98FJSLox" + link: statutory-instruments/98FJSLox content: statutoryInstrumentPaperName - 22 - name: link data: - link: "/statutory-instruments.T3N7uNwm" + link: statutory-instruments/T3N7uNwm content: statutoryInstrumentPaperName - 23 - name: link data: - link: "/statutory-instruments.8I8GntKQ" + link: statutory-instruments/8I8GntKQ content: statutoryInstrumentPaperName - 24 - name: link data: - link: "/statutory-instruments.TuBqZl6z" + link: statutory-instruments/TuBqZl6z content: statutoryInstrumentPaperName - 25 - name: link data: - link: "/statutory-instruments.YeYkel8w" + link: statutory-instruments/YeYkel8w content: statutoryInstrumentPaperName - 26 - name: link data: - link: "/statutory-instruments.QmvfCS3N" + link: statutory-instruments/QmvfCS3N content: statutoryInstrumentPaperName - 27 - name: link data: - link: "/statutory-instruments.eD6E73Ne" + link: statutory-instruments/eD6E73Ne content: statutoryInstrumentPaperName - 28 - name: link data: - link: "/statutory-instruments.5U4yBcY4" + link: statutory-instruments/5U4yBcY4 content: statutoryInstrumentPaperName - 29 - name: link data: - link: "/statutory-instruments.ADR23Zyx" + link: statutory-instruments/ADR23Zyx content: statutoryInstrumentPaperName - 30 - name: link data: - link: "/statutory-instruments.lh2dYuHD" + link: statutory-instruments/lh2dYuHD content: statutoryInstrumentPaperName - 31 - name: link data: - link: "/statutory-instruments.R63aWjPi" + link: statutory-instruments/R63aWjPi content: statutoryInstrumentPaperName - 32 - name: link data: - link: "/statutory-instruments.xic2yu5i" + link: statutory-instruments/xic2yu5i content: statutoryInstrumentPaperName - 33 - name: link data: - link: "/statutory-instruments.Ly5VtVqc" + link: statutory-instruments/Ly5VtVqc content: statutoryInstrumentPaperName - 34 - name: link data: - link: "/statutory-instruments.W0xWx2Iu" + link: statutory-instruments/W0xWx2Iu content: statutoryInstrumentPaperName - 35 - name: link data: - link: "/statutory-instruments.C2rRbqeQ" + link: statutory-instruments/C2rRbqeQ content: statutoryInstrumentPaperName - 36 - name: link data: - link: "/statutory-instruments.On2R0Zeb" + link: statutory-instruments/On2R0Zeb content: statutoryInstrumentPaperName - 37 - name: link data: - link: "/statutory-instruments.daySypEn" + link: statutory-instruments/daySypEn content: statutoryInstrumentPaperName - 38 - name: link data: - link: "/statutory-instruments.XnLvIexa" + link: statutory-instruments/XnLvIexa content: statutoryInstrumentPaperName - 39 - name: link data: - link: "/statutory-instruments.QbI1sir4" + link: statutory-instruments/QbI1sir4 content: statutoryInstrumentPaperName - 40 - name: link data: - link: "/statutory-instruments.FXiTnP7V" + link: statutory-instruments/FXiTnP7V content: statutoryInstrumentPaperName - 41 - name: link data: - link: "/statutory-instruments.XGB9Cj8C" + link: statutory-instruments/XGB9Cj8C content: statutoryInstrumentPaperName - 42 - name: link data: - link: "/statutory-instruments.ITuNnxmw" + link: statutory-instruments/ITuNnxmw content: statutoryInstrumentPaperName - 43 - name: link data: - link: "/statutory-instruments.upP2FHa4" + link: statutory-instruments/upP2FHa4 content: statutoryInstrumentPaperName - 44 - name: link data: - link: "/statutory-instruments.9PuVurua" - content: statutoryInstrumentPaperName - 1 + link: statutory-instruments/9PuVurua + content: statutoryInstrumentPaperName - 45 - name: link data: - link: "/statutory-instruments.Q2dC6z5O" + link: statutory-instruments/Q2dC6z5O content: statutoryInstrumentPaperName - 46 - name: link data: - link: "/statutory-instruments.k6waZgmJ" + link: statutory-instruments/k6waZgmJ content: statutoryInstrumentPaperName - 47 - name: link data: - link: "/statutory-instruments.LxPDdl92" + link: statutory-instruments/LxPDdl92 content: statutoryInstrumentPaperName - 48 - name: link data: - link: "/statutory-instruments.z0dWm7t5" + link: statutory-instruments/z0dWm7t5 content: statutoryInstrumentPaperName - 49 - name: link data: - link: "/statutory-instruments.3dAYwLoB" + link: statutory-instruments/3dAYwLoB content: statutoryInstrumentPaperName - 50 - name: link data: - link: "/statutory-instruments.0VJbg1Pa" + link: statutory-instruments/0VJbg1Pa content: statutoryInstrumentPaperName - 51 - name: link data: - link: "/statutory-instruments.bS94erG6" + link: statutory-instruments/bS94erG6 content: statutoryInstrumentPaperName - 52 - name: link data: - link: "/statutory-instruments.WSBR9sBz" + link: statutory-instruments/WSBR9sBz content: statutoryInstrumentPaperName - 53 - name: link data: - link: "/statutory-instruments.RcGToJSJ" + link: statutory-instruments/RcGToJSJ content: statutoryInstrumentPaperName - 54 - name: link data: - link: "/statutory-instruments.YFkBxYkE" + link: statutory-instruments/YFkBxYkE content: statutoryInstrumentPaperName - 55 - name: link data: - link: "/statutory-instruments.AaXxxzda" + link: statutory-instruments/AaXxxzda content: statutoryInstrumentPaperName - 56 - name: link data: - link: "/statutory-instruments.hNQPUtRs" + link: statutory-instruments/hNQPUtRs content: statutoryInstrumentPaperName - 57 - name: link data: - link: "/statutory-instruments.5urR0FTa" + link: statutory-instruments/5urR0FTa content: statutoryInstrumentPaperName - 58 - name: link data: - link: "/statutory-instruments.Y70OJpm2" + link: statutory-instruments/Y70OJpm2 content: statutoryInstrumentPaperName - 59 - name: link data: - link: "/statutory-instruments.BdanAxAh" + link: statutory-instruments/BdanAxAh content: statutoryInstrumentPaperName - 60 - name: link data: - link: "/statutory-instruments.bUEOr4ad" + link: statutory-instruments/bUEOr4ad content: statutoryInstrumentPaperName - 61 - name: link data: - link: "/statutory-instruments.dNxWbKuU" + link: statutory-instruments/dNxWbKuU content: statutoryInstrumentPaperName - 62 - name: link data: - link: "/statutory-instruments.UnwGTBEq" + link: statutory-instruments/UnwGTBEq content: statutoryInstrumentPaperName - 63 - name: link data: - link: "/statutory-instruments.ijAPvpBd" + link: statutory-instruments/ijAPvpBd content: statutoryInstrumentPaperName - 64 - name: link data: - link: "/statutory-instruments.ZIUjUqOY" + link: statutory-instruments/ZIUjUqOY content: statutoryInstrumentPaperName - 65 - name: link data: - link: "/statutory-instruments.8HUWJm9e" + link: statutory-instruments/8HUWJm9e content: statutoryInstrumentPaperName - 66 - name: link data: - link: "/statutory-instruments.YOVMhcqy" + link: statutory-instruments/YOVMhcqy content: statutoryInstrumentPaperName - 67 - name: link data: - link: "/statutory-instruments.rAkViDvo" + link: statutory-instruments/rAkViDvo content: statutoryInstrumentPaperName - 68 - name: link data: - link: "/statutory-instruments.5pJMwiMT" + link: statutory-instruments/5pJMwiMT content: statutoryInstrumentPaperName - 69 - name: link data: - link: "/statutory-instruments.rjzMGG28" + link: statutory-instruments/rjzMGG28 content: statutoryInstrumentPaperName - 70 - name: link data: - link: "/statutory-instruments.NRSdVnQe" + link: statutory-instruments/NRSdVnQe content: statutoryInstrumentPaperName - 71 - name: link data: - link: "/statutory-instruments.oPe8W6LR" + link: statutory-instruments/oPe8W6LR content: statutoryInstrumentPaperName - 72 - name: link data: - link: "/statutory-instruments.KUKpCZa3" + link: statutory-instruments/KUKpCZa3 content: statutoryInstrumentPaperName - 73 - name: link data: - link: "/statutory-instruments.z0qrw2Ka" + link: statutory-instruments/z0qrw2Ka content: statutoryInstrumentPaperName - 74 - name: link data: - link: "/statutory-instruments.181ZoViL" + link: statutory-instruments/181ZoViL content: statutoryInstrumentPaperName - 75 - name: link data: - link: "/statutory-instruments.eqmSAYR6" + link: statutory-instruments/eqmSAYR6 content: statutoryInstrumentPaperName - 76 - name: link data: - link: "/statutory-instruments.58xXcnw9" + link: statutory-instruments/58xXcnw9 content: statutoryInstrumentPaperName - 77 - name: link data: - link: "/statutory-instruments.cmbxjWzh" + link: statutory-instruments/cmbxjWzh content: statutoryInstrumentPaperName - 78 - name: link data: - link: "/statutory-instruments.pw7G14pf" + link: statutory-instruments/pw7G14pf content: statutoryInstrumentPaperName - 79 - name: link data: - link: "/statutory-instruments.v2fDLDBe" + link: statutory-instruments/v2fDLDBe content: statutoryInstrumentPaperName - 80 - name: link data: - link: "/statutory-instruments.ez3sdNNT" + link: statutory-instruments/ez3sdNNT content: statutoryInstrumentPaperName - 81 - name: link data: - link: "/statutory-instruments.9WjR8ian" + link: statutory-instruments/9WjR8ian content: statutoryInstrumentPaperName - 82 - name: link data: - link: "/statutory-instruments.4EdTvost" + link: statutory-instruments/4EdTvost content: statutoryInstrumentPaperName - 83 - name: link data: - link: "/statutory-instruments.ZZqT1pd0" + link: statutory-instruments/ZZqT1pd0 content: statutoryInstrumentPaperName - 84 - name: link data: - link: "/statutory-instruments.yvJQZWRS" + link: statutory-instruments/yvJQZWRS content: statutoryInstrumentPaperName - 85 - name: link data: - link: "/statutory-instruments.CHZfxISd" + link: statutory-instruments/CHZfxISd content: statutoryInstrumentPaperName - 86 - name: link data: - link: "/statutory-instruments.olhuTQTg" + link: statutory-instruments/olhuTQTg content: statutoryInstrumentPaperName - 87 - name: link data: - link: "/statutory-instruments.b9hRtbhC" + link: statutory-instruments/b9hRtbhC content: statutoryInstrumentPaperName - 88 - name: link data: - link: "/statutory-instruments.IYqCRJN5" + link: statutory-instruments/IYqCRJN5 content: statutoryInstrumentPaperName - 89 - name: link data: - link: "/statutory-instruments.T7oi7f0E" + link: statutory-instruments/T7oi7f0E content: statutoryInstrumentPaperName - 90 - name: link data: - link: "/statutory-instruments.YZnLn72f" + link: statutory-instruments/YZnLn72f content: statutoryInstrumentPaperName - 91 - name: link data: - link: "/statutory-instruments.hs0US9Hw" + link: statutory-instruments/hs0US9Hw content: statutoryInstrumentPaperName - 92 - name: link data: - link: "/statutory-instruments.w3m931qg" + link: statutory-instruments/w3m931qg content: statutoryInstrumentPaperName - 93 - name: link data: - link: "/statutory-instruments.tiA7a71r" + link: statutory-instruments/tiA7a71r content: statutoryInstrumentPaperName - 94 - name: link data: - link: "/statutory-instruments.wzOpc7Aj" + link: statutory-instruments/wzOpc7Aj content: statutoryInstrumentPaperName - 95 - name: link data: - link: "/statutory-instruments.8xNcqHgV" + link: statutory-instruments/8xNcqHgV content: statutoryInstrumentPaperName - 96 - name: link data: - link: "/statutory-instruments.Keztycwl" + link: statutory-instruments/Keztycwl content: statutoryInstrumentPaperName - 97 - name: link data: - link: "/statutory-instruments.jKgfbLZG" + link: statutory-instruments/jKgfbLZG content: statutoryInstrumentPaperName - 98 - name: link data: - link: "/statutory-instruments.LldrrMNS" + link: statutory-instruments/LldrrMNS content: statutoryInstrumentPaperName - 99 - name: link data: - link: "/statutory-instruments.nohxpB6K" + link: statutory-instruments/nohxpB6K content: statutoryInstrumentPaperName - 100 - name: link data: - link: "/statutory-instruments.PhwmELqG" + link: statutory-instruments/PhwmELqG content: statutoryInstrumentPaperName - 101 - name: link data: - link: "/statutory-instruments.1IUldWII" + link: statutory-instruments/1IUldWII content: statutoryInstrumentPaperName - 102 - name: link data: - link: "/statutory-instruments.BN7ucM8o" + link: statutory-instruments/BN7ucM8o content: statutoryInstrumentPaperName - 103 - name: link data: - link: "/statutory-instruments.Z1VEYuzd" + link: statutory-instruments/Z1VEYuzd content: statutoryInstrumentPaperName - 104 - name: link data: - link: "/statutory-instruments.PyLlquNq" + link: statutory-instruments/PyLlquNq content: statutoryInstrumentPaperName - 105 - name: link data: - link: "/statutory-instruments.WOETQ8oL" + link: statutory-instruments/WOETQ8oL content: statutoryInstrumentPaperName - 106 - name: link data: - link: "/statutory-instruments.aQaZuLyK" + link: statutory-instruments/aQaZuLyK content: statutoryInstrumentPaperName - 107 - name: link data: - link: "/statutory-instruments.66skcwzN" + link: statutory-instruments/66skcwzN content: statutoryInstrumentPaperName - 108 - name: link data: - link: "/statutory-instruments.nky6NCi1" + link: statutory-instruments/nky6NCi1 content: statutoryInstrumentPaperName - 109 - name: link data: - link: "/statutory-instruments.I9rWxORS" + link: statutory-instruments/I9rWxORS content: statutoryInstrumentPaperName - 110 - name: link data: - link: "/statutory-instruments.N3pbTe7F" + link: statutory-instruments/N3pbTe7F content: statutoryInstrumentPaperName - 111 - name: link data: - link: "/statutory-instruments.leJaKS5E" + link: statutory-instruments/leJaKS5E content: statutoryInstrumentPaperName - 112 - name: link data: - link: "/statutory-instruments.rMrXIRPv" + link: statutory-instruments/rMrXIRPv content: statutoryInstrumentPaperName - 113 - name: link data: - link: "/statutory-instruments.hMaj7XDd" + link: statutory-instruments/hMaj7XDd content: statutoryInstrumentPaperName - 114 - name: link data: - link: "/statutory-instruments.itrbNOwE" + link: statutory-instruments/itrbNOwE content: statutoryInstrumentPaperName - 115 - name: link data: - link: "/statutory-instruments.Y5ihrxeg" + link: statutory-instruments/Y5ihrxeg content: statutoryInstrumentPaperName - 116 - name: link data: - link: "/statutory-instruments.uhL6bPvV" + link: statutory-instruments/uhL6bPvV content: statutoryInstrumentPaperName - 117 - name: link data: - link: "/statutory-instruments.MJRZgm6X" + link: statutory-instruments/MJRZgm6X content: statutoryInstrumentPaperName - 118 - name: link data: - link: "/statutory-instruments.rdYNYrB9" + link: statutory-instruments/rdYNYrB9 content: statutoryInstrumentPaperName - 119 - name: link data: - link: "/statutory-instruments.9Nv0gELe" + link: statutory-instruments/9Nv0gELe content: statutoryInstrumentPaperName - 120 - name: link data: - link: "/statutory-instruments.D9vkxjm0" + link: statutory-instruments/D9vkxjm0 content: statutoryInstrumentPaperName - 121 - name: link data: - link: "/statutory-instruments.kqzXWiAO" + link: statutory-instruments/kqzXWiAO content: statutoryInstrumentPaperName - 122 - name: link data: - link: "/statutory-instruments.0vmjY7Jb" + link: statutory-instruments/0vmjY7Jb content: statutoryInstrumentPaperName - 123 - name: link data: - link: "/statutory-instruments.vBqvzucr" + link: statutory-instruments/vBqvzucr content: statutoryInstrumentPaperName - 124 - name: link data: - link: "/statutory-instruments.ITytkRlT" + link: statutory-instruments/ITytkRlT content: statutoryInstrumentPaperName - 125 - name: link data: - link: "/statutory-instruments.vPuOxy1B" + link: statutory-instruments/vPuOxy1B content: statutoryInstrumentPaperName - 126 - name: link data: - link: "/statutory-instruments.GHIocidH" + link: statutory-instruments/GHIocidH content: statutoryInstrumentPaperName - 127 - name: link data: - link: "/statutory-instruments.avoNURrR" + link: statutory-instruments/avoNURrR content: statutoryInstrumentPaperName - 128 - name: link data: - link: "/statutory-instruments.s75qT4mw" + link: statutory-instruments/s75qT4mw content: statutoryInstrumentPaperName - 129 - name: link data: - link: "/statutory-instruments.tZhWfLGW" + link: statutory-instruments/tZhWfLGW content: statutoryInstrumentPaperName - 130 - name: link data: - link: "/statutory-instruments.J9KZUC1q" + link: statutory-instruments/J9KZUC1q content: statutoryInstrumentPaperName - 131 - name: link data: - link: "/statutory-instruments.9S89Uofh" + link: statutory-instruments/9S89Uofh content: statutoryInstrumentPaperName - 132 - name: link data: - link: "/statutory-instruments.xa91QFSm" + link: statutory-instruments/xa91QFSm content: statutoryInstrumentPaperName - 133 - name: link data: - link: "/statutory-instruments.YI5L3LfM" + link: statutory-instruments/YI5L3LfM content: statutoryInstrumentPaperName - 134 - name: link data: - link: "/statutory-instruments.4e7ROEBU" + link: statutory-instruments/4e7ROEBU content: statutoryInstrumentPaperName - 135 - name: link data: - link: "/statutory-instruments.X9tJrtug" + link: statutory-instruments/X9tJrtug content: statutoryInstrumentPaperName - 136 - name: link data: - link: "/statutory-instruments.7uCF2qgm" + link: statutory-instruments/7uCF2qgm content: statutoryInstrumentPaperName - 137 - name: link data: - link: "/statutory-instruments.4bwmdrUh" + link: statutory-instruments/4bwmdrUh content: statutoryInstrumentPaperName - 138 - name: link data: - link: "/statutory-instruments.YhMNMpYo" + link: statutory-instruments/YhMNMpYo content: statutoryInstrumentPaperName - 139 - name: link data: - link: "/statutory-instruments.GVXkRR2M" + link: statutory-instruments/GVXkRR2M content: statutoryInstrumentPaperName - 140 - name: link data: - link: "/statutory-instruments.N1TcXxev" + link: statutory-instruments/N1TcXxev content: statutoryInstrumentPaperName - 141 - name: link data: - link: "/statutory-instruments.YdZGzcJA" + link: statutory-instruments/YdZGzcJA content: statutoryInstrumentPaperName - 142 - name: link data: - link: "/statutory-instruments.u2nfODML" + link: statutory-instruments/u2nfODML content: statutoryInstrumentPaperName - 143 - name: link data: - link: "/statutory-instruments.MJ4ILVps" + link: statutory-instruments/MJ4ILVps content: statutoryInstrumentPaperName - 144 - name: link data: - link: "/statutory-instruments.6XQ6ig48" + link: statutory-instruments/6XQ6ig48 content: statutoryInstrumentPaperName - 145 - name: link data: - link: "/statutory-instruments.OohXDEMJ" + link: statutory-instruments/OohXDEMJ content: statutoryInstrumentPaperName - 146 - name: link data: - link: "/statutory-instruments.HNjL6uzv" + link: statutory-instruments/HNjL6uzv content: statutoryInstrumentPaperName - 147 - name: link data: - link: "/statutory-instruments.4kSUJ4K2" + link: statutory-instruments/4kSUJ4K2 content: statutoryInstrumentPaperName - 148 - name: link data: - link: "/statutory-instruments.h8w2BHwS" + link: statutory-instruments/h8w2BHwS content: statutoryInstrumentPaperName - 149 - name: link data: - link: "/statutory-instruments.VdxVTQ0L" + link: statutory-instruments/VdxVTQ0L content: statutoryInstrumentPaperName - 150 - name: link data: - link: "/statutory-instruments.UD4HjKbu" + link: statutory-instruments/UD4HjKbu content: statutoryInstrumentPaperName - 151 - name: link data: - link: "/statutory-instruments.mRgc1Qvc" + link: statutory-instruments/mRgc1Qvc content: statutoryInstrumentPaperName - 152 - name: link data: - link: "/statutory-instruments.CMCJ3a82" + link: statutory-instruments/CMCJ3a82 content: statutoryInstrumentPaperName - 153 - name: link data: - link: "/statutory-instruments.HZod54jz" + link: statutory-instruments/HZod54jz content: statutoryInstrumentPaperName - 154 - name: link data: - link: "/statutory-instruments.zfcsMSD3" + link: statutory-instruments/zfcsMSD3 content: statutoryInstrumentPaperName - 155 - name: link data: - link: "/statutory-instruments.P5Zu6fkP" + link: statutory-instruments/P5Zu6fkP content: statutoryInstrumentPaperName - 156 - name: link data: - link: "/statutory-instruments.5dLGzkeI" + link: statutory-instruments/5dLGzkeI content: statutoryInstrumentPaperName - 157 - name: link data: - link: "/statutory-instruments.98auwKwP" + link: statutory-instruments/98auwKwP content: statutoryInstrumentPaperName - 158 - name: link data: - link: "/statutory-instruments.NTd30zpo" + link: statutory-instruments/NTd30zpo content: statutoryInstrumentPaperName - 159 - name: link data: - link: "/statutory-instruments.m1AZ18wg" + link: statutory-instruments/m1AZ18wg content: statutoryInstrumentPaperName - 160 - name: link data: - link: "/statutory-instruments.Foe6fVxK" + link: statutory-instruments/Foe6fVxK content: statutoryInstrumentPaperName - 161 - name: link data: - link: "/statutory-instruments.c0IpQmwt" + link: statutory-instruments/c0IpQmwt content: statutoryInstrumentPaperName - 162 - name: link data: - link: "/statutory-instruments.RS3W2NQw" + link: statutory-instruments/RS3W2NQw content: statutoryInstrumentPaperName - 163 - name: link data: - link: "/statutory-instruments.BZPGfEza" + link: statutory-instruments/BZPGfEza content: statutoryInstrumentPaperName - 164 - name: link data: - link: "/statutory-instruments.4GqD7K0p" + link: statutory-instruments/4GqD7K0p content: statutoryInstrumentPaperName - 165 - name: link data: - link: "/statutory-instruments.JPx0duf2" + link: statutory-instruments/JPx0duf2 content: statutoryInstrumentPaperName - 166 - name: link data: - link: "/statutory-instruments.C8kKvTBL" + link: statutory-instruments/C8kKvTBL content: statutoryInstrumentPaperName - 167 - name: link data: - link: "/statutory-instruments.2KKfR6RI" + link: statutory-instruments/2KKfR6RI content: statutoryInstrumentPaperName - 168 - name: link data: - link: "/statutory-instruments.JXxhQblu" + link: statutory-instruments/JXxhQblu content: statutoryInstrumentPaperName - 169 - name: link data: - link: "/statutory-instruments.9Brknpn7" + link: statutory-instruments/9Brknpn7 content: statutoryInstrumentPaperName - 170 - name: link data: - link: "/statutory-instruments.IjLgnN8z" + link: statutory-instruments/IjLgnN8z content: statutoryInstrumentPaperName - 171 - name: link data: - link: "/statutory-instruments.1aUCYOe7" + link: statutory-instruments/1aUCYOe7 content: statutoryInstrumentPaperName - 172 - name: link data: - link: "/statutory-instruments.SUtuR6qs" + link: statutory-instruments/SUtuR6qs content: statutoryInstrumentPaperName - 173 - name: link data: - link: "/statutory-instruments.MIqYKT1i" + link: statutory-instruments/MIqYKT1i content: statutoryInstrumentPaperName - 174 - name: link data: - link: "/statutory-instruments.zd4ymhhN" + link: statutory-instruments/zd4ymhhN content: statutoryInstrumentPaperName - 175 - name: link data: - link: "/statutory-instruments.YhwigIF6" + link: statutory-instruments/YhwigIF6 content: statutoryInstrumentPaperName - 176 - name: link data: - link: "/statutory-instruments.KF90wtY4" + link: statutory-instruments/KF90wtY4 content: statutoryInstrumentPaperName - 177 - name: link data: - link: "/statutory-instruments.UBL9i00X" + link: statutory-instruments/UBL9i00X content: statutoryInstrumentPaperName - 178 - name: link data: - link: "/statutory-instruments.gcbZWM8q" + link: statutory-instruments/gcbZWM8q content: statutoryInstrumentPaperName - 179 - name: link data: - link: "/statutory-instruments.Hw2xKRsZ" + link: statutory-instruments/Hw2xKRsZ content: statutoryInstrumentPaperName - 180 - name: link data: - link: "/statutory-instruments.cXKDMYqV" + link: statutory-instruments/cXKDMYqV content: statutoryInstrumentPaperName - 181 - name: link data: - link: "/statutory-instruments.bYMAmxYQ" + link: statutory-instruments/bYMAmxYQ content: statutoryInstrumentPaperName - 182 - name: link data: - link: "/statutory-instruments.BRZBy463" + link: statutory-instruments/BRZBy463 content: statutoryInstrumentPaperName - 183 - name: link data: - link: "/statutory-instruments.vUb6Fcnn" + link: statutory-instruments/vUb6Fcnn content: statutoryInstrumentPaperName - 184 - name: link data: - link: "/statutory-instruments.cDVVk8C2" + link: statutory-instruments/cDVVk8C2 content: statutoryInstrumentPaperName - 185 - name: link data: - link: "/statutory-instruments.wIlQG2bb" + link: statutory-instruments/wIlQG2bb content: statutoryInstrumentPaperName - 186 - name: link data: - link: "/statutory-instruments.55gPdheg" + link: statutory-instruments/55gPdheg content: statutoryInstrumentPaperName - 187 - name: link data: - link: "/statutory-instruments.QsAJ99E3" + link: statutory-instruments/QsAJ99E3 content: statutoryInstrumentPaperName - 188 - name: link data: - link: "/statutory-instruments.ySndNUxm" + link: statutory-instruments/ySndNUxm content: statutoryInstrumentPaperName - 189 - name: link data: - link: "/statutory-instruments.JHmYoIfJ" + link: statutory-instruments/JHmYoIfJ content: statutoryInstrumentPaperName - 190 - name: link data: - link: "/statutory-instruments.qSs9kGvu" + link: statutory-instruments/qSs9kGvu content: statutoryInstrumentPaperName - 191 - name: link data: - link: "/statutory-instruments.Qeou2KIY" + link: statutory-instruments/Qeou2KIY content: statutoryInstrumentPaperName - 192 - name: link data: - link: "/statutory-instruments.zVuPoOWp" + link: statutory-instruments/zVuPoOWp content: statutoryInstrumentPaperName - 193 - name: link data: - link: "/statutory-instruments.DS1GQhA5" + link: statutory-instruments/DS1GQhA5 content: statutoryInstrumentPaperName - 194 - name: link data: - link: "/statutory-instruments.VXLHPnoP" + link: statutory-instruments/VXLHPnoP content: statutoryInstrumentPaperName - 195 - name: link data: - link: "/statutory-instruments.m6w1ruLC" + link: statutory-instruments/m6w1ruLC content: statutoryInstrumentPaperName - 196 - name: link data: - link: "/statutory-instruments.a8wT3ym2" + link: statutory-instruments/a8wT3ym2 content: statutoryInstrumentPaperName - 197 - name: link data: - link: "/statutory-instruments.QI5WArIQ" + link: statutory-instruments/QI5WArIQ content: statutoryInstrumentPaperName - 198 - name: link data: - link: "/statutory-instruments.Uhsvsfdn" + link: statutory-instruments/Uhsvsfdn content: statutoryInstrumentPaperName - 199 - name: link data: - link: "/statutory-instruments.uPVA7EvA" + link: statutory-instruments/uPVA7EvA content: statutoryInstrumentPaperName - 200 - name: link data: - link: "/statutory-instruments.EqisWZtW" + link: statutory-instruments/EqisWZtW content: statutoryInstrumentPaperName - 201 - name: link data: - link: "/statutory-instruments.M3L8iguJ" + link: statutory-instruments/M3L8iguJ content: statutoryInstrumentPaperName - 202 - name: link data: - link: "/statutory-instruments.BP4IoUgX" + link: statutory-instruments/BP4IoUgX content: statutoryInstrumentPaperName - 203 - name: link data: - link: "/statutory-instruments.pyflzxxb" + link: statutory-instruments/pyflzxxb content: statutoryInstrumentPaperName - 204 - name: link data: - link: "/statutory-instruments.xItHTyZP" + link: statutory-instruments/xItHTyZP content: statutoryInstrumentPaperName - 205 - name: link data: - link: "/statutory-instruments.bnrksmBb" + link: statutory-instruments/bnrksmBb content: statutoryInstrumentPaperName - 206 - name: link data: - link: "/statutory-instruments.ORfYwwEX" + link: statutory-instruments/ORfYwwEX content: statutoryInstrumentPaperName - 207 - name: link data: - link: "/statutory-instruments.SbxmGLcR" + link: statutory-instruments/SbxmGLcR content: statutoryInstrumentPaperName - 208 - name: link data: - link: "/statutory-instruments.xRUG9ARI" + link: statutory-instruments/xRUG9ARI content: statutoryInstrumentPaperName - 209 - name: link data: - link: "/statutory-instruments.2JipSGt3" + link: statutory-instruments/2JipSGt3 content: statutoryInstrumentPaperName - 210 - name: link data: - link: "/statutory-instruments.pg1MaN6V" + link: statutory-instruments/pg1MaN6V content: statutoryInstrumentPaperName - 211 - name: link data: - link: "/statutory-instruments.qRweamaE" + link: statutory-instruments/qRweamaE content: statutoryInstrumentPaperName - 212 - name: link data: - link: "/statutory-instruments.dHwDR0Xw" + link: statutory-instruments/dHwDR0Xw content: statutoryInstrumentPaperName - 213 - name: link data: - link: "/statutory-instruments.zRBB7JhE" + link: statutory-instruments/zRBB7JhE content: statutoryInstrumentPaperName - 214 - name: link data: - link: "/statutory-instruments.ePPVgmgN" + link: statutory-instruments/ePPVgmgN content: statutoryInstrumentPaperName - 215 - name: link data: - link: "/statutory-instruments.DVgODdNe" + link: statutory-instruments/DVgODdNe content: statutoryInstrumentPaperName - 216 - name: link data: - link: "/statutory-instruments.j0R3vR5s" + link: statutory-instruments/j0R3vR5s content: statutoryInstrumentPaperName - 217 - name: link data: - link: "/statutory-instruments.YdIWHZS3" + link: statutory-instruments/YdIWHZS3 content: statutoryInstrumentPaperName - 218 - name: link data: - link: "/statutory-instruments.uIHeCzNz" + link: statutory-instruments/uIHeCzNz content: statutoryInstrumentPaperName - 219 - name: link data: - link: "/statutory-instruments.I22Wlejq" + link: statutory-instruments/I22Wlejq content: statutoryInstrumentPaperName - 220 - name: link data: - link: "/statutory-instruments.3ovJSqCK" + link: statutory-instruments/3ovJSqCK content: statutoryInstrumentPaperName - 221 - name: link data: - link: "/statutory-instruments.URYwfkWz" + link: statutory-instruments/URYwfkWz content: statutoryInstrumentPaperName - 222 - name: link data: - link: "/statutory-instruments.zo2QN0LF" + link: statutory-instruments/zo2QN0LF content: statutoryInstrumentPaperName - 223 - name: link data: - link: "/statutory-instruments.3Iw5OmCs" + link: statutory-instruments/3Iw5OmCs content: statutoryInstrumentPaperName - 224 - name: link data: - link: "/statutory-instruments.tlSbgoyG" + link: statutory-instruments/tlSbgoyG content: statutoryInstrumentPaperName - 225 - name: link data: - link: "/statutory-instruments.hLF7ZU6f" + link: statutory-instruments/hLF7ZU6f content: statutoryInstrumentPaperName - 226 - name: link data: - link: "/statutory-instruments.KKMVpl6g" + link: statutory-instruments/KKMVpl6g content: statutoryInstrumentPaperName - 227 - name: link data: - link: "/statutory-instruments.2zCfE0jG" + link: statutory-instruments/2zCfE0jG content: statutoryInstrumentPaperName - 228 - name: link data: - link: "/statutory-instruments.fqzYAhp8" + link: statutory-instruments/fqzYAhp8 content: statutoryInstrumentPaperName - 229 - name: link data: - link: "/statutory-instruments.MyKmEbhB" + link: statutory-instruments/MyKmEbhB content: statutoryInstrumentPaperName - 230 - name: link data: - link: "/statutory-instruments.hNYeAr2M" + link: statutory-instruments/hNYeAr2M content: statutoryInstrumentPaperName - 231 - name: link data: - link: "/statutory-instruments.VqC2MUZE" + link: statutory-instruments/VqC2MUZE content: statutoryInstrumentPaperName - 232 - name: link data: - link: "/statutory-instruments.AbFupFPb" + link: statutory-instruments/AbFupFPb content: statutoryInstrumentPaperName - 233 - name: link data: - link: "/statutory-instruments.QtfEa5YW" + link: statutory-instruments/QtfEa5YW content: statutoryInstrumentPaperName - 234 - name: link data: - link: "/statutory-instruments.IlH0bFJC" + link: statutory-instruments/IlH0bFJC content: statutoryInstrumentPaperName - 235 footer-components: - name: footer diff --git a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml index 80672142..8b1e6e53 100644 --- a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml +++ b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml @@ -85,11 +85,11 @@ main-components: components: - name: link data: - link: "/statutory-instruments.A1234567" + link: proposed-negative-statutory-instruments/A1234567 content: SI Paper A - name: link data: - link: "/statutory-instruments.B1234567" + link: proposed-negative-statutory-instruments/B1234567 content: SI Paper B footer-components: - name: footer diff --git a/spec/fixtures/serializers/page_serializer/statutory_instruments_index_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/statutory_instruments_index_page_serializer/fixture.yml index a50d49f2..be704331 100644 --- a/spec/fixtures/serializers/page_serializer/statutory_instruments_index_page_serializer/fixture.yml +++ b/spec/fixtures/serializers/page_serializer/statutory_instruments_index_page_serializer/fixture.yml @@ -92,11 +92,11 @@ main-components: components: - name: link data: - link: "/statutory-instruments.A1234567" + link: statutory-instruments/A1234567 content: SI Paper A - name: link data: - link: "/statutory-instruments.B1234567" + link: statutory-instruments/B1234567 content: SI Paper B footer-components: - name: footer From c7f1e3fb4437386517704b7319cf8de7f92ff1ce Mon Sep 17 00:00:00 2001 From: Rebecca Appleyard Date: Wed, 19 Sep 2018 16:20:37 +0100 Subject: [PATCH 3/3] Fixed tests after rebase --- .../component_serializer/paragraph_component_serializer.rb | 2 +- .../page_serializer/laid_thing_show_page_serializer.rb | 2 +- app/serializers/page_serializer/list_page_serializer.rb | 4 ++-- ..._negative_statutory_instruments_show_page_serializer.rb | 4 ++-- .../index/fixture.yml | 7 +++++++ .../show/fixture.yml | 7 +++++++ .../statutory_instruments_controller/index/fixture.yml | 2 +- .../laid_thing_show_page_serializer/fixture.yml | 7 +++++++ .../laid_thing_missing_data.yml | 7 +++++++ .../fixture.yml | 7 +++++++ .../fixture.yml | 7 +++++++ .../si_missing_data.yml | 7 +++++++ .../laid_thing_show_page_serializer_spec.rb | 2 +- .../page_serializer/list_page_serializer_spec.rb | 4 ++-- 14 files changed, 59 insertions(+), 10 deletions(-) diff --git a/app/serializers/component_serializer/paragraph_component_serializer.rb b/app/serializers/component_serializer/paragraph_component_serializer.rb index 3cb4d036..e65cf8e9 100644 --- a/app/serializers/component_serializer/paragraph_component_serializer.rb +++ b/app/serializers/component_serializer/paragraph_component_serializer.rb @@ -7,7 +7,7 @@ class ParagraphComponentSerializer < ComponentSerializer::BaseComponentSerialize # @example Initialising a paragraph component # string_or_translation_key = 'Here is some paragraph text' # link = 'beta.parliament.uk' - # ComponentSerializer::ParagraphComponentSerializer.new([{ content: string_or_translation_key, link: link }]).to_h + # ComponentSerializer::ParagraphComponentSerializer.new(content: [{ content: string_or_translation_key, link: link }]).to_h def initialize(content: nil) @content = content end diff --git a/app/serializers/page_serializer/laid_thing_show_page_serializer.rb b/app/serializers/page_serializer/laid_thing_show_page_serializer.rb index 6b291ffd..1a0c16bf 100644 --- a/app/serializers/page_serializer/laid_thing_show_page_serializer.rb +++ b/app/serializers/page_serializer/laid_thing_show_page_serializer.rb @@ -35,7 +35,7 @@ def parent_child_objects def object_heading_paragraph(heading_size, heading_content, paragraph_content) [].tap do |components| components << ComponentSerializer::HeadingComponentSerializer.new(content: heading_content, size: heading_size).to_h - components << ComponentSerializer::ParagraphComponentSerializer.new([{ content: paragraph_content }]).to_h + components << ComponentSerializer::ParagraphComponentSerializer.new(content: [{ content: paragraph_content }]).to_h end end diff --git a/app/serializers/page_serializer/list_page_serializer.rb b/app/serializers/page_serializer/list_page_serializer.rb index 937349c9..888c80c9 100644 --- a/app/serializers/page_serializer/list_page_serializer.rb +++ b/app/serializers/page_serializer/list_page_serializer.rb @@ -23,8 +23,8 @@ def meta def content [].tap do |content| - content << ComponentSerializer::SectionComponentSerializer.new(section_primary_components, type: 'primary').to_h - content << ComponentSerializer::SectionComponentSerializer.new(section_components, type: 'section').to_h + content << ComponentSerializer::SectionComponentSerializer.new(components: section_primary_components, type: 'primary').to_h + content << ComponentSerializer::SectionComponentSerializer.new(components: section_components, type: 'section').to_h end end diff --git a/app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb b/app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb index 261eae01..368799d4 100644 --- a/app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb +++ b/app/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer.rb @@ -25,8 +25,8 @@ def title def content [].tap do |components| - components << ComponentSerializer::SectionComponentSerializer.new(section_primary_components, type: 'primary').to_h - components << ComponentSerializer::SectionComponentSerializer.new(section_objects, type: 'section').to_h + components << ComponentSerializer::SectionComponentSerializer.new(components: section_primary_components, type: 'primary').to_h + components << ComponentSerializer::SectionComponentSerializer.new(components: section_objects, type: 'section').to_h end end diff --git a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml index de50062a..32806686 100644 --- a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml +++ b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/index/fixture.yml @@ -78,6 +78,13 @@ header-components: components: - name: icon__uk-parliament data: shared.header.label + - name: form__search + data: + global: true + label: search.label + components: + - name: icon__search + data: search.search-icon main-components: - name: section__primary data: diff --git a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml index 555ebe90..922246f6 100644 --- a/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml +++ b/spec/fixtures/controllers/proposed_negative_statutory_instruments_controller/show/fixture.yml @@ -78,6 +78,13 @@ header-components: components: - name: icon__uk-parliament data: shared.header.label + - name: form__search + data: + global: true + label: search.label + components: + - name: icon__search + data: search.search-icon main-components: - name: section__primary data: diff --git a/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml b/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml index 97773920..df38ed87 100644 --- a/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml +++ b/spec/fixtures/controllers/statutory_instruments_controller/index/fixture.yml @@ -284,7 +284,7 @@ main-components: - name: link data: link: statutory-instruments/9PuVurua - content: statutoryInstrumentPaperName - 45 + content: statutoryInstrumentPaperName - 1 - name: link data: link: statutory-instruments/Q2dC6z5O diff --git a/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml index 26414a6c..3765cd7a 100644 --- a/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml +++ b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/fixture.yml @@ -63,6 +63,13 @@ header-components: components: - name: icon__uk-parliament data: shared.header.label + - name: form__search + data: + global: true + label: search.label + components: + - name: icon__search + data: search.search-icon main-components: footer-components: - name: footer diff --git a/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml index 26414a6c..3765cd7a 100644 --- a/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml +++ b/spec/fixtures/serializers/page_serializer/laid_thing_show_page_serializer/laid_thing_missing_data.yml @@ -63,6 +63,13 @@ header-components: components: - name: icon__uk-parliament data: shared.header.label + - name: form__search + data: + global: true + label: search.label + components: + - name: icon__search + data: search.search-icon main-components: footer-components: - name: footer diff --git a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml index 8b1e6e53..84c24977 100644 --- a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml +++ b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_index_page_serializer/fixture.yml @@ -63,6 +63,13 @@ header-components: components: - name: icon__uk-parliament data: shared.header.label + - name: form__search + data: + global: true + label: search.label + components: + - name: icon__search + data: search.search-icon main-components: - name: section__primary data: diff --git a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml index ff5f9941..c49a8557 100644 --- a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml +++ b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/fixture.yml @@ -63,6 +63,13 @@ header-components: components: - name: icon__uk-parliament data: shared.header.label + - name: form__search + data: + global: true + label: search.label + components: + - name: icon__search + data: search.search-icon main-components: - name: section__primary data: diff --git a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml index c5e62031..f765536e 100644 --- a/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml +++ b/spec/fixtures/serializers/page_serializer/proposed_negative_statutory_instruments_show_page_serializer/si_missing_data.yml @@ -63,6 +63,13 @@ header-components: components: - name: icon__uk-parliament data: shared.header.label + - name: form__search + data: + global: true + label: search.label + components: + - name: icon__search + data: search.search-icon main-components: - name: section__primary data: diff --git a/spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb b/spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb index d453dd81..6516b9bf 100644 --- a/spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb +++ b/spec/serializers/page_serializer/laid_thing_show_page_serializer_spec.rb @@ -19,7 +19,7 @@ context '#to_h' do it 'produces the expected JSON hash' do - +create_fixture(subject, 'fixture') expected = get_fixture('fixture') expect(subject.to_yaml).to eq expected diff --git a/spec/serializers/page_serializer/list_page_serializer_spec.rb b/spec/serializers/page_serializer/list_page_serializer_spec.rb index 12122bc3..60db0bea 100644 --- a/spec/serializers/page_serializer/list_page_serializer_spec.rb +++ b/spec/serializers/page_serializer/list_page_serializer_spec.rb @@ -15,8 +15,8 @@ it 'receives the correct serializers' do subject.to_h - expect(ComponentSerializer::SectionComponentSerializer).to have_received(:new).with([], type: 'primary') - expect(ComponentSerializer::SectionComponentSerializer).to have_received(:new).with([], type: 'section') + expect(ComponentSerializer::SectionComponentSerializer).to have_received(:new).with(components: [], type: 'primary') + expect(ComponentSerializer::SectionComponentSerializer).to have_received(:new).with(components: [], type: 'section') end end end