aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-04-10 08:07:31 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2013-04-10 08:11:43 +0100
commit17a886b2759cb70ecebd174adeeac14e29bb8a11 (patch)
tree277a3d3a4b38b211d926c68e35203b55dc2a9214 /railties
parentfa3ef8e82ab2f96cf15ef9bc885b2468fad77621 (diff)
downloadrails-17a886b2759cb70ecebd174adeeac14e29bb8a11.tar.gz
rails-17a886b2759cb70ecebd174adeeac14e29bb8a11.tar.bz2
rails-17a886b2759cb70ecebd174adeeac14e29bb8a11.zip
Add failing test case for #9654
Diffstat (limited to 'railties')
-rw-r--r--railties/test/application/rendering_test.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/railties/test/application/rendering_test.rb b/railties/test/application/rendering_test.rb
new file mode 100644
index 0000000000..588d64dde9
--- /dev/null
+++ b/railties/test/application/rendering_test.rb
@@ -0,0 +1,45 @@
+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
+ boot_rails
+ end
+
+ def teardown
+ teardown_app
+ end
+
+ test "Unknown format falls back to HTML template" do
+ app_file 'config/routes.rb', <<-RUBY
+ AppTemplate::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