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