Skip to content

Commit

Permalink
tests: Don't start DotcomWeb.Endpoint as a server in tests (#2180)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlarson authored Oct 4, 2024
1 parent eb42f71 commit e6dd565
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
6 changes: 0 additions & 6 deletions config/deps/endpoint.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,3 @@ if config_env() == :dev do
]
]
end

if config_env() == :test do
config :dotcom, DotcomWeb.Endpoint,
http: [port: 4002],
server: true
end
12 changes: 6 additions & 6 deletions test/cms/paragraph_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,12 @@ defmodule CMS.ParagraphTest do
assert safe_to_string(sub_topic_1.description) =~
~s(<p>This is a similar description, but of a sub-topic. It can also have <a href="https://www.google.com">HTML</a> in it.)

assert %File{
description: "",
type: "application/pdf",
url:
"http://localhost:4002/sites/default/files/2021-10/2021-10-13-english-bus-network-redesign-public-meetings.pdf"
} = List.first(files)
file = List.first(files)
assert file.description == ""
assert file.type == "application/pdf"

assert file.url =~
"/sites/default/files/2021-10/2021-10-13-english-bus-network-redesign-public-meetings.pdf"

assert %Link{
title: "Google",
Expand Down
2 changes: 1 addition & 1 deletion test/cms/partial/banner_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ defmodule CMS.Partial.BannerTest do
assert thumb_alt == "Commuter Rail train crossing a bridge in Ashland"

assert thumb_url =~
"http://localhost:4002/sites/default/files/styles/important_notice/public/media/2018-09/P519%20Ashland_retouch.jpg?itok=5NKSY_ts"
"/sites/default/files/styles/important_notice/public/media/2018-09/P519%20Ashland_retouch.jpg?itok=5NKSY_ts"
end
end
2 changes: 1 addition & 1 deletion test/cms/partial/whats_happening_item_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ defmodule CMS.Partial.WhatsHappeningItemTest do
assert alt == "A bus at night in downtown Boston, Photo by Osman Rana, via Unsplash."

assert url =~
"http://localhost:4002/sites/default/files/styles/whats_happening" <>
"/sites/default/files/styles/whats_happening" <>
"/public/projects/late-night-bus/night-bus-by-osman-rana-unsplash.jpg?itok=K3LGpv53"
end

Expand Down

0 comments on commit e6dd565

Please sign in to comment.