2019-04-29 19:27:42 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-01-17 23:03:38 -06:00
|
|
|
RSpec.describe ExceptionsController do
|
|
|
|
describe "#not_found" do
|
|
|
|
it "should return the right response" do
|
|
|
|
get "/404"
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
|
2022-05-17 10:37:43 -05:00
|
|
|
expect(response.body).to have_tag(
|
|
|
|
"title",
|
2023-01-09 05:18:21 -06:00
|
|
|
text: "#{I18n.t("page_not_found.page_title")} - #{SiteSetting.title}",
|
2022-05-17 10:37:43 -05:00
|
|
|
)
|
|
|
|
|
2023-01-09 05:18:21 -06:00
|
|
|
expect(response.body).to have_tag("img", with: { src: SiteSetting.site_logo_url })
|
2019-01-17 23:03:38 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "text site logo" do
|
2023-01-09 05:18:21 -06:00
|
|
|
before { SiteSetting.logo = nil }
|
2019-01-17 23:03:38 -06:00
|
|
|
|
|
|
|
it "should return the right response" do
|
|
|
|
get "/404"
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
|
2023-01-09 05:18:21 -06:00
|
|
|
expect(response.body).to have_tag("h2", text: SiteSetting.title)
|
2019-01-17 23:03:38 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|