Skip to content

Commit 2fbb276

Browse files
committed
Make webchat test not rely on a particular URL
1 parent 5095507 commit 2fbb276

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/presenters/contact_presenter_test.rb

+10-2
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,19 @@ def schema_name
8585
end
8686

8787
test "presents webchat" do
88+
chats = Webchat.load_all
89+
return if chats.empty?
90+
91+
base_path = chats.first.base_path
92+
availability_url = chats.first.availability_url
93+
open_url = chats.first.open_url
94+
8895
schema = schema_item("contact_with_webchat")
96+
schema["base_path"] = base_path
8997
presented = present_example(schema)
9098
assert_equal true, presented.show_webchat?
91-
assert_equal presented.webchat.availability_url, "https://hmrc-uk.digital.nuance.com/tagserver/launch/agentAvailability?agentGroupID=10006852&siteID=10006719&businessUnitID=19001235&q-thresh=1"
92-
assert_equal presented.webchat.open_url, "https://tax.service.gov.uk/ask-hmrc/webchat/income-tax-enquiries-for-individuals-pensioners-and-employees"
99+
assert_equal presented.webchat.availability_url, availability_url
100+
assert_equal presented.webchat.open_url, open_url
93101
end
94102
end
95103
end

0 commit comments

Comments
 (0)