Skip to content

Commit

Permalink
Fixes #37623 - Use html format in react controller for ics domains
Browse files Browse the repository at this point in the history
When having a domain with a .ics extension we get a
ActionView::MissingTemplate: Missing template react/index error. This
PR change forces the react controller to use the HTML format.
With this change the host is able to be loaded in the UI.
  • Loading branch information
chris1984 authored and ekohl committed Aug 16, 2024
1 parent 4f562db commit 44160c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/react_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class ReactController < ApplicationController

def index
response.headers['X-Request-Path'] = request.path
render 'react/index'
render("react/index", formats: [:html])
end
end
8 changes: 8 additions & 0 deletions test/integration/host_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ class HostIntegrationTest < ActionDispatch::IntegrationTest
assert page.has_link?('Export', href: current_hosts_path(format: 'csv', search: "name = #{@host.name}"))
end

describe "view host page" do
test "host with .ics extension" do
domain = FactoryBot.create(:domain, name: 'example.ics')
host = FactoryBot.create(:host, domain: domain)
visit host_details_page_path(host)
end
end

describe "create new host page" do
test "tabs are present" do
assert_new_button(current_hosts_path, "Create Host", new_host_path)
Expand Down

0 comments on commit 44160c0

Please sign in to comment.