2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-01-18 00:03:38 -05: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 02:29:17 -05:00
|
|
|
src: SiteSetting.site_logo_url
|
2019-01-18 00:03:38 -05:00
|
|
|
}
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "text site logo" do
|
|
|
|
before do
|
2019-01-02 02:29:17 -05:00
|
|
|
SiteSetting.logo = nil
|
2019-01-18 00:03:38 -05: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 02:29:17 -05:00
|
|
|
text: SiteSetting.title
|
2019-01-18 00:03:38 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|