Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add test for polymorphic respond_with case

  • Loading branch information...
commit c4f9256838204a64544f1267dbe91b4ba7b8a730 1 parent d6d3cb4
@nashby nashby authored
Showing with 20 additions and 0 deletions.
  1. +20 −0 test/flash_responder_test.rb
View
20 test/flash_responder_test.rb
@@ -51,6 +51,12 @@ def set_resource
end
end
+class PolymorphicAddesssController < AddressesController
+ def create
+ respond_with(User.new, Address.new)
+ end
+end
+
module Admin
class AddressesController < ::AddressesController
end
@@ -237,3 +243,17 @@ def test_does_not_fallbacks_to_non_namespaced_controller_flash_message_if_disabl
assert_equal nil, flash[:notice]
end
end
+
+class PolymorhicFlashResponderTest < ActionController::TestCase
+ tests PolymorphicAddesssController
+
+ def setup
+ Responders::FlashResponder.flash_keys = [ :notice, :alert ]
+ @controller.stubs(:polymorphic_url).returns("/")
+ end
+
+ def test_polymorhic_respond_with
+ post :create
+ assert_equal "Address was successfully created.", flash[:notice]
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.