Files
bionickatana 0826d267f2
CI / scan_ruby (push) Failing after 1m5s
CI / scan_js (push) Failing after 6s
CI / lint (push) Failing after 1m29s
Finished phase005
2026-09-16 15:34:50 -06:00

35 lines
1009 B
Ruby

require "rails_helper"
RSpec.describe "Home" do
describe "GET /" do
before { identify_user }
it "returns the vehicle index" do
get root_path
expect(response).to have_http_status(:ok)
expect(response.body).to include("Vehicles")
expect(response.body).to include("stylesheet")
expect(response.body).to include("importmap")
end
it "renders successfully when a content security policy is configured" do
original_policy = Rails.application.config.content_security_policy
Rails.application.config.content_security_policy do |policy|
policy.default_src :self
end
get root_path
expect(response).to have_http_status(:ok)
ensure
Rails.application.config.instance_variable_set(:@content_security_policy, original_policy)
end
end
def identify_user(user = create(:user))
access_key = AccessKey.current
post session_path, params: { name: user.name, email: user.email, key: access_key.raw_key }
end
end