[rspec-users] RSpec stub/mock I18n

2009-08-20 Thread BallaBall
I have some model with the following validation: validates_inclusion_of :value, :in => I18n.available_locales.map(&:to_s) I would think that I would be able to stub out that method in a test like so: it "should accepted any available locale as a value" do I18n.stub!(:available_locales

Re: [rspec-users] RSpec stub/mock I18n

2009-08-20 Thread BallaBall
> Linhareshttp://codeshooter.wordpress.com/|http://twitter.com/mauriciojr > > > > On Thu, Aug 20, 2009 at 5:03 PM, BallaBall wrote: > > I have some model with the following validation: > > >  validates_inclusion_of :value, > >    :in => I18n.available_locales.m