Skip to content

Commit

Permalink
test mock url
Browse files Browse the repository at this point in the history
  • Loading branch information
CEdwardsBlasikiewicz committed Dec 11, 2024
1 parent c28a3d9 commit b81da8a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/files/global_messages/global_message.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
11 changes: 11 additions & 0 deletions spec/support/webmock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit b81da8a

Please sign in to comment.