2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-01-18 13:03:38 +08: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 23:37:43 +08:00
|
|
|
expect(response.body).to have_tag(
|
|
|
|
"title",
|
|
|
|
text: "#{I18n.t("page_not_found.page_title")} - #{SiteSetting.title}",
|
|
|
|
)
|
|
|
|
|
2019-01-18 13:03:38 +08:00
|
|
|
expect(response.body).to have_tag("img", with: { src: SiteSetting.site_logo_url })
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "text site logo" do
|
2019-01-02 15:29:17 +08:00
|
|
|
before { SiteSetting.logo = nil }
|
2019-01-18 13:03:38 +08:00
|
|
|
|
|
|
|
it "should return the right response" do
|
|
|
|
get "/404"
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
|
|
|
|
expect(response.body).to have_tag("h2", text: SiteSetting.title)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|