Hello all,

I am trying to find a way to set the flash for a view helper test. The
purpose of my view helper is to simplify rendering of flash messages,
and I'd like to be able to test it by passing a mocked flash object to
the helper method in my tests. I'm not quite sure how to do this,
perhaps by mocking somehow?

Here was my first attempt that did not work:

context "flash_messages" do
  setup do
    @flash = { :notice => "A notification message }
    @result = flash_messages
  end

  ...
end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to