aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-08-17 11:54:09 -0700
committerGodfrey Chan <godfreykfc@gmail.com>2014-08-17 11:54:09 -0700
commit24226c51f075ed8d8e721cdefb6d2661c0a1f53a (patch)
treecc2dd2e420755a2991fcd44c0a2993d6092e99f3 /actionpack/test
parent69ed422a9c534224eb818636d79d4263e2abd0a2 (diff)
downloadrails-24226c51f075ed8d8e721cdefb6d2661c0a1f53a.tar.gz
rails-24226c51f075ed8d8e721cdefb6d2661c0a1f53a.tar.bz2
rails-24226c51f075ed8d8e721cdefb6d2661c0a1f53a.zip
Raise a more helpful error for people who are using these extracted features
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/mime/responder_test.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/actionpack/test/controller/mime/responder_test.rb b/actionpack/test/controller/mime/responder_test.rb
new file mode 100644
index 0000000000..6201af3299
--- /dev/null
+++ b/actionpack/test/controller/mime/responder_test.rb
@@ -0,0 +1,30 @@
+require 'abstract_unit'
+require 'controller/fake_models'
+
+class ResponderTest < ActionController::TestCase
+ def test_class_level_respond_to
+ e = assert_raises(NoMethodError) do
+ Class.new(ActionController::Base) do
+ respond_to :json
+ end
+ end
+
+ assert_includes e.message, '`responder` gem'
+ end
+
+ def test_respond_with
+ klass = Class.new(ActionController::Base) do
+ def index
+ respond_with Customer.new("david", 13)
+ end
+ end
+
+ @controller = klass.new
+
+ e = assert_raises(NoMethodError) do
+ get :index
+ end
+
+ assert_includes e.message, '`responder` gem'
+ end
+end