class NamespacedFlashResponderTest

Public Instance Methods

setup() click to toggle source
# File test/flash_responder_test.rb, line 211
def setup
  Responders::FlashResponder.flash_keys = [ :notice, :alert ]
  @controller.stubs(:polymorphic_url).returns("/")
end
test_does_not_fallbacks_to_namespaced_actions_if_disabled() click to toggle source
# File test/flash_responder_test.rb, line 237
def test_does_not_fallbacks_to_namespaced_actions_if_disabled
  post :create
  assert_equal "Address was successfully created.", flash[:notice]
end
test_does_not_fallbacks_to_non_namespaced_controller_flash_message_if_disabled() click to toggle source
# File test/flash_responder_test.rb, line 242
def test_does_not_fallbacks_to_non_namespaced_controller_flash_message_if_disabled
  post :new
  assert_equal nil, flash[:notice]
end
test_fallbacks_to_non_namespaced_controller_flash_message() click to toggle source
# File test/flash_responder_test.rb, line 229
def test_fallbacks_to_non_namespaced_controller_flash_message
  Responders::FlashResponder.namespace_lookup = true
  delete :destroy
  assert_equal "Successfully deleted the chosen address at Ocean Avenue", flash[:notice]
ensure
  Responders::FlashResponder.namespace_lookup = false
end
test_sets_the_flash_message_based_on_namespace_actions() click to toggle source
# File test/flash_responder_test.rb, line 221
def test_sets_the_flash_message_based_on_namespace_actions
  Responders::FlashResponder.namespace_lookup = true
  post :create
  assert_equal "Admin created address with success", flash[:notice]
ensure
  Responders::FlashResponder.namespace_lookup = false
end
test_sets_the_flash_message_based_on_the_current_controller() click to toggle source
# File test/flash_responder_test.rb, line 216
def test_sets_the_flash_message_based_on_the_current_controller
  put :update
  assert_equal "Admin updated address with success", flash[:notice]
end