summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2015-01-17 12:32:35 -0700
committermo khan <mo@mokhan.ca>2015-01-17 12:32:35 -0700
commitb0fb328f154100a3af62b748e094048d19191e47 (patch)
treed32f6a8391cb2d7b5d8cdae6990f649e5526a10f /spec/services
parent5f6261b7040b225a7b8504e5e018a4cb94f20564 (diff)
remove old publish to twitter handler.
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/handlers/publish_cake_to_twitter_spec.rb47
1 files changed, 0 insertions, 47 deletions
diff --git a/spec/services/handlers/publish_cake_to_twitter_spec.rb b/spec/services/handlers/publish_cake_to_twitter_spec.rb
deleted file mode 100644
index 028e35d6..00000000
--- a/spec/services/handlers/publish_cake_to_twitter_spec.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-require "rails_helper"
-
-describe PublishCakeToTwitter do
- let(:twitter) { double(tweet: '') }
- let(:cakes) { double }
-
- subject { PublishCakeToTwitter.new(twitter, cakes) }
-
- describe "#handles?" do
- it "handles cake_published" do
- expect(subject.handles?(:cake_published)).to be_truthy
- end
- end
-
- describe "#handle" do
- let(:artist) { User.new(name: 'joe') }
- let(:cake) { Creation.new(id: id, name: 'yummy') }
- let(:id) { 88 }
-
- before :each do
- allow(cake).to receive(:user).and_return(artist)
- allow(cakes).to receive(:find).with(id).and_return(cake)
- end
-
- context "when the cake is published and safe for kids" do
- before :each do
- allow(cake).to receive(:published?).and_return(true)
- end
-
- it "tweets new cakes" do
- subject.handle(cake_id: id)
- expect(twitter).to have_received(:tweet).with("yummy By joe on http://www.blah.com/cakes/88-yummy!")
- end
- end
-
- context "when the cake is not published" do
- before :each do
- allow(cake).to receive(:published?).and_return(false)
- end
-
- it "should not publish any tweets" do
- subject.handle(cake_id: id)
- expect(twitter).not_to have_received(:tweet)
- end
- end
- end
-end