spec/mailstro/test_strategy_spec.rb in mailstro-0.0.8 vs spec/mailstro/test_strategy_spec.rb in mailstro-0.0.9

- old
+ new

@@ -7,27 +7,15 @@ end describe '.enable' do it "doesn't send anything when enabled" do Mailstro::Delivery.should_not_receive(:deliver) - Mailstro::ListDelivery.should_not_receive(:deliver) - Mailstro::ListSubscribe.should_not_receive(:deliver) - Mailstro::ListUnsubscribe.should_not_receive(:deliver) Mailstro.deliver( :to => 'a@a.com', :template_name => :welcome ) - - Mailstro.subscribe('a@a.com', :watchers, 12) - - Mailstro.deliver( - :to => [:watchers, 12], - :template_name => :welcome - ) - - Mailstro.unsubscribe('a@a.com', :watchers, 12) end end describe '.has_delivered?' do context "with a delivery" do @@ -57,65 +45,8 @@ Mailstro.should_not have_delivered( :to => 'b@a.com', :template_name => :welcome, ) end - end - - context "with a list delivery" do - before do - Mailstro.deliver( - :to => [:build_watchers, 'mailstro/mailstro-ruby'], - :template_name => :build_failed - ) - end - - it "matches against list type, name and template name" do - Mailstro.should have_delivered( - :to_list_type => :build_watchers, - :to_list_name => 'mailstro/mailstro-ruby', - :template_name => :build_failed, - ) - end - - it "does not match an invalid list type" do - Mailstro.should_not have_delivered( - :to_list_type => :customers, - :to_list_name => 'mailstro/mailstro-ruby', - :template_name => :build_failed, - ) - end - - it "does not match an invalid list name" do - Mailstro.should_not have_delivered( - :to_list_type => :build_watchers, - :to_list_name => 'mailstro/mailstro', - :template_name => :build_failed, - ) - end - - it "does not match an invalid template name" do - Mailstro.should_not have_delivered( - :to_list_type => :build_watchers, - :to_list_name => 'mailstro/mailstro-ruby', - :template_name => :welcome, - ) - end - end - end - - describe '.has_subsribed?' do - it 'keeps a record of subscribes' do - Mailstro.subscribe('a@a.com', :watchers, 2) - - Mailstro.should have_subscribed('a@a.com', :watchers, 2) - end - end - - describe '.has_unsubsribed?' do - it 'keeps a record of unsubscribes' do - Mailstro.unsubscribe('a@a.com', :watchers, 2) - - Mailstro.should have_unsubscribed('a@a.com', :watchers, 2) end end end