Skip to content

Commit

Permalink
Test custom controller names
Browse files Browse the repository at this point in the history
  • Loading branch information
zachahn committed Sep 20, 2021
1 parent b7f4557 commit a5f2a39
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/custom_controller_name_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require "test_helper"

class CustomControllerNameTest < ActionDispatch::IntegrationTest
controller(ApplicationController, controller_name: "CustomsController") do
def index
render plain: self.class.name
end
end

test "route matches controller name" do
get "/customs"
assert_equal(200, response.status)
end

test "controller name is correct" do
get "/customs"
assert_equal("CustomsController", response.body)
end
end

0 comments on commit a5f2a39

Please sign in to comment.