Sha256: 44bd8b857ab19d7a73148442d15efead63c359ece2134406d28b19f5389357dd
Contents?: true
Size: 1.14 KB
Versions: 19
Compression:
Stored size: 1.14 KB
Contents
require 'spec_helper' describe Saucy::Configuration do it "has layouts" do subject.layouts.should be_a(Saucy::Layouts) end it "has a mailer_sender" do subject.mailer_sender.should_not be_nil end it "has a nil merchant_account_id" do subject.merchant_account_id.should be_nil end it "can listen for events" do observer = stub("an observer") cleanup_observers do Saucy::Configuration.observe(observer) Saucy::Configuration.observers.should include(observer) end end it "can notify observers" do observer = stub("an observer", :some_event => nil) cleanup_observers do Saucy::Configuration.observe(observer) Saucy::Configuration.notify("some_event", "some_data") observer.should have_received("some_event").with("some_data") end end it "can assign a mailer sender" do old_sender = subject.mailer_sender begin subject.mailer_sender = 'newsender@example.com' subject.mailer_sender.should == 'newsender@example.com' ensure subject.mailer_sender = old_sender end end def cleanup_observers yield ensure subject.observers.clear end end
Version data entries
19 entries across 19 versions & 1 rubygems