rails/railties/test/application/rendering_test.rb
Matthew Draper 87b3e226d6 Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
2017-07-02 02:15:17 +09:30

45 lines
948 B
Ruby

require "isolation/abstract_unit"
require "rack/test"
module ApplicationTests
class RoutingTest < ActiveSupport::TestCase
include ActiveSupport::Testing::Isolation
include Rack::Test::Methods
def setup
build_app
end
def teardown
teardown_app
end
test "Unknown format falls back to HTML template" do
app_file "config/routes.rb", <<-RUBY
Rails.application.routes.draw do
get 'pages/:id', to: 'pages#show'
end
RUBY
app_file "app/controllers/pages_controller.rb", <<-RUBY
class PagesController < ApplicationController
layout false
def show
end
end
RUBY
app_file "app/views/pages/show.html.erb", <<-RUBY
<%= params[:id] %>
RUBY
get "/pages/foo"
assert_equal 200, last_response.status
get "/pages/foo.bar"
assert_equal 200, last_response.status
end
end
end