cirandas.net

ref: master

test/integration/controller_naming_test.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require_relative "../test_helper"

class ControllerNamingTest < ActionDispatch::IntegrationTest

  should 'not have controllers with same name in different folders' do
    controllers = Dir.glob(Rails.root.join("app", "controllers", "**", "*_controller.rb")).map { |item| item.split(/\//).last }
    assert_equal controllers.uniq, controllers
  end

end