Re: [rspec-users] alternate way to stub out I18n translations?

2012-05-30 Thread Katrina Owen
On Wed, May 30, 2012 at 8:55 PM, Patrick J. Collins wrote: > Does any one know of a way to temporarily add an entry into my en.yml > locale dynamically? I usually do something like this in the before filter en = { :my => { :stuff => 'things' } } I18n.backend.store_translations(:en, en) Ch

[rspec-users] alternate way to stub out I18n translations?

2012-05-30 Thread Patrick J. Collins
Hi, I've run into a bit of a snag... I have a method like this class Thing def bar I18n.t("waka.waka", { :fozzy => "bear" }) end end And I was trying to make a test that did: describe "#bar" do it "translates like a mo fo" do I18n.stubs(:t).with("waka.waka", { :fozzy => "bear" })

Re: [rspec-users] RSpec testing update action with ajax

2012-05-30 Thread Justin Ko
On May 30, 2012, at 3:18 AM, zombiebit wrote: > Hey, > I want to test my Rails app. When you click the image ajax sends to data to > DB and the data is updated in there. When I try to test, I faced with this > problem, > > > 1) RwsController Update widget score takes widget rate information >

[rspec-users] RSpec testing update action with ajax

2012-05-30 Thread zombiebit
Hey, I want to test my Rails app. When you click the image ajax sends to data to DB and the data is updated in there. When I try to test, I faced with this problem, 1) RwsController Update widget score takes widget rate information Failure/Error: mock_widget.should_receive(:update_attribut