Skip to content

Commit

Permalink
fixes test in spec
Browse files Browse the repository at this point in the history
  • Loading branch information
siuying committed Feb 11, 2012
1 parent 8c1d8bc commit adcdb34
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spec/jobs/site_fetcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
@mailer.should_not_receive(:notify_error).should_not_receive(:notify_resolved)
SiteFetcher.perform(@site.id, @mailer)
end

it "should send when status is change from ok to fail" do
@site = FactoryGirl.create(:ok_site)
@watcher.stub(:watch => "failed")

@mailer.should_receive(:notify_error).and_return(stub(:mailer, :deliver => true))
@mailer.should_not_receive(:notify_resolved)

SiteFetcher.perform(@site.id, @mailer)
end

Expand All @@ -33,17 +33,17 @@
@mailer.should_not_receive(:notify_error)
@mailer.should_receive(:notify_resolved).and_return(stub(:mailer, :deliver => true))

SiteFetcher.perform(@site.id)
SiteFetcher.perform(@site.id, @mailer)
end

it "should not email when status is change from unknown to ok" do
@site = FactoryGirl.create(:site)
@watcher.stub(:watch => "ok")

@mailer.should_not_receive(:notify_error)
@mailer.should_not_receive(:notify_resolved)

SiteFetcher.perform(@site.id)
SiteFetcher.perform(@site.id, @mailer)
end

it "should send when status is change from unknown to fail" do
Expand All @@ -53,7 +53,7 @@
@mailer.should_not_receive(:notify_resolved)
@mailer.should_receive(:notify_error).and_return(stub(:mailer, :deliver => true))

SiteFetcher.perform(@site.id)
SiteFetcher.perform(@site.id, @mailer)
end
end
end

0 comments on commit adcdb34

Please sign in to comment.