2019-01-18 13:03:38 +08:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe ExceptionsController do
|
|
|
|
describe "#not_found" do
|
|
|
|
it "should return the right response" do
|
|
|
|
get "/404"
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
|
|
|
|
expect(response.body).to have_tag(
|
|
|
|
"img",
|
|
|
|
with: {
|
2019-01-02 15:29:17 +08:00
|
|
|
src: SiteSetting.site_logo_url
|
2019-01-18 13:03:38 +08:00
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "text site logo" do
|
|
|
|
before do
|
2019-01-02 15:29:17 +08:00
|
|
|
SiteSetting.logo = nil
|
2019-01-18 13:03:38 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it "should return the right response" do
|
|
|
|
get "/404"
|
|
|
|
|
|
|
|
expect(response.status).to eq(404)
|
|
|
|
|
|
|
|
expect(response.body).to have_tag(
|
|
|
|
"h2",
|
2019-01-02 15:29:17 +08:00
|
|
|
text: SiteSetting.title
|
2019-01-18 13:03:38 +08:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|