DEV: Update specs to avoid dependence on ember-cli build (#24347)
The `src` of js files is now dependent on the ember-cli/webpack build, so it's not a good thing to check in specs. In CI it passes because the ember-cli build is not run. But locally it would fail if you had a build in `app/assets/javascripts/discourse/dist`. This commit updates the specs to check for the presence of a stable data attribute instead.
This commit is contained in:
parent
1dad379412
commit
e2e454c480
|
@ -10,7 +10,12 @@ RSpec.describe InvitesController do
|
||||||
it "shows the accept invite page" do
|
it "shows the accept invite page" do
|
||||||
get "/invites/#{invite.invite_key}"
|
get "/invites/#{invite.invite_key}"
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
expect(response.body).to have_tag(:script, with: { src: "/assets/discourse.js" })
|
expect(response.body).to have_tag(
|
||||||
|
:script,
|
||||||
|
with: {
|
||||||
|
"data-discourse-entrypoint" => "discourse",
|
||||||
|
},
|
||||||
|
)
|
||||||
expect(response.body).not_to include(invite.email)
|
expect(response.body).not_to include(invite.email)
|
||||||
expect(response.body).to_not include(
|
expect(response.body).to_not include(
|
||||||
I18n.t(
|
I18n.t(
|
||||||
|
|
|
@ -2714,7 +2714,7 @@ RSpec.describe TopicsController do
|
||||||
|
|
||||||
body = response.body
|
body = response.body
|
||||||
|
|
||||||
expect(body).to have_tag(:script, src: "/assets/discourse.js")
|
expect(body).to have_tag(:script, with: { "data-discourse-entrypoint" => "discourse" })
|
||||||
expect(body).to have_tag(:meta, with: { name: "fragment" })
|
expect(body).to have_tag(:meta, with: { name: "fragment" })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3116,7 +3116,7 @@ RSpec.describe TopicsController do
|
||||||
body = response.body
|
body = response.body
|
||||||
|
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
expect(body).to have_tag(:script, with: { src: "/assets/discourse.js" })
|
expect(body).to have_tag(:script, with: { "data-discourse-entrypoint" => "discourse" })
|
||||||
expect(body).to_not have_tag(:meta, with: { name: "fragment" })
|
expect(body).to_not have_tag(:meta, with: { name: "fragment" })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -3129,7 +3129,7 @@ RSpec.describe TopicsController do
|
||||||
|
|
||||||
body = response.body
|
body = response.body
|
||||||
|
|
||||||
expect(body).to have_tag(:script, with: { src: "/assets/discourse.js" })
|
expect(body).to have_tag(:script, with: { "data-discourse-entrypoint" => "discourse" })
|
||||||
expect(body).to have_tag(:meta, with: { name: "fragment" })
|
expect(body).to have_tag(:meta, with: { name: "fragment" })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5162,7 +5162,7 @@ RSpec.describe TopicsController do
|
||||||
|
|
||||||
body = response.body
|
body = response.body
|
||||||
|
|
||||||
expect(body).to have_tag(:script, with: { src: "/assets/discourse.js" })
|
expect(body).to have_tag(:script, with: { "data-discourse-entrypoint" => "discourse" })
|
||||||
expect(body).to have_tag(:meta, with: { name: "fragment" })
|
expect(body).to have_tag(:meta, with: { name: "fragment" })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue