Permalink
Browse files

assert_not_flash_now should require that the flash is set

Otherwise it would return a false positive when the flash wasn't set at
all.
  • Loading branch information...
iain committed Jul 9, 2011
1 parent d36fc1a commit e98dd3c602471602ba2d475f77baa4e8723f1beb
Showing with 1 addition and 1 deletion.
  1. +1 −1 test/flash_responder_test.rb
@@ -147,7 +147,6 @@ def test_sets_flash_now_on_failure_by_default
def test_never_set_flash_now
post :flexible, :fail => true, :responder_options => { :flash_now => false, :alert => "Warning" }
- assert flash[:alert].present?, "Flash should be present"
assert_not_flash_now :alert
end
@@ -158,6 +157,7 @@ def assert_flash_now(k)
end
def assert_not_flash_now(k)
+ assert flash.has_key?(k), "Expected #{k} to be set"
assert !flash.instance_variable_get(:@used).include?(k.to_sym),
"Expected #{k} to not be in flash.now, but it is."
end

0 comments on commit e98dd3c

Please sign in to comment.