Skip to content
Browse files

failing test for #6022

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent 61950a4 commit f5fba917f8dbf45fcbf04b4b26cf54eb3b300057 @neerajdotname neerajdotname committed with josevalim
Showing with 34 additions and 0 deletions.
  1. +34 −0 actionpack/test/controller/mime_responds_test.rb
View
34 actionpack/test/controller/mime_responds_test.rb
@@ -2,6 +2,14 @@
require 'controller/fake_models'
require 'active_support/core_ext/hash/conversions'
+class StarStarMimeController < ActionController::Base
+ layout nil
+
+ def index
+ render
+ end
+end
+
class RespondToController < ActionController::Base
layout :set_layout
@@ -160,6 +168,32 @@ def set_layout
end
end
+class StarStarMimeControllerTest < ActionController::TestCase
+ tests StarStarMimeController
+
+ def setup; super; end
+ def teardown; super; end
+
+ def test_javascript_with_format
+ @request.accept = "text/javascript"
+ get :index, :format => 'js'
+ assert_match "function addition(a,b){ return a+b; }", @response.body
+ end
+
+ def test_javascript_with_no_format
+ @request.accept = "text/javascript"
+ get :index
+ assert_match "function addition(a,b){ return a+b; }", @response.body
+ end
+
+ def test_javascript_with_no_format_only_star_star
+ @request.accept = "*/*"
+ get :index
+ assert_match "function addition(a,b){ return a+b; }", @response.body
+ end
+
+end
+
class RespondToControllerTest < ActionController::TestCase
tests RespondToController

0 comments on commit f5fba91

Please sign in to comment.
Something went wrong with that request. Please try again.