diff --git a/spec/files/global_messages/global_message.json b/spec/files/global_messages/global_message.json new file mode 100644 index 00000000..1d55a3ff --- /dev/null +++ b/spec/files/global_messages/global_message.json @@ -0,0 +1,6 @@ +[ + { + "Title": "\u003Ca href=\"/node/1607\" hreflang=\"en\"\u003ECatalogue Message\u003C/a\u003E", + "body": "\u003Cp\u003EThe Library's summer opening hours are in place from Monday 23 December 2024 until Wednesday 1 January 2025 (inclusive). Before planning your visit, check our \u003Ca href=\"https://www.library.gov.au/visit/opening-hours\"\u003Eopening hours\u003C/a\u003E and \u003Ca href=\"https://www.library.gov.au/research/access-collection/temporary-changes-collection-access\"\u003Etemporary changes to collection access\u003C/a\u003E.\u003C/p\u003E" + } +] \ No newline at end of file diff --git a/spec/support/webmock.rb b/spec/support/webmock.rb index 4d55c829..6acdf957 100644 --- a/spec/support/webmock.rb +++ b/spec/support/webmock.rb @@ -279,5 +279,16 @@ } ) .to_return(status: 200, body: email_2fa, headers: {}) + + global_message = IO.read("spec/files/global_message.json") + + WebMock.stub_request(:get, "https://www.library.gov.au/catalogue-message") + .with( + headers: { + "Accept" => "application/json", + "Accept-Encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" + } + ) + .to_return(status: 200, body: global_message, headers: {}) end end