search for: gitoriousconfig

Displaying 1 result from an estimated 1 matches for "gitoriousconfig".

2008 May 06
2
Can you use RSpec to test initializers?
...e code that will set the smtp_settings in a custom ActiveMailer object. Basically I want to check that if my configuration object has the right smtp_server, that the ActiveMailer object gets set up correctly. So, my spec looks like this: it "uses smtp server if config says so" do GitoriousConfig.should_receive(:[]).with(''smtp_settings'').and_return({ :address => "smtp.postoffice.net", }) Mailer.smtp_settings[:address].should == "smtp.postoffice.net" end The trouble is, the code that sets the mailer settings is in an initializer (co...