Welcome to mirror list, hosted at ThFree Co, Russian Federation.

reshared_spec.rb « mail « workers « spec - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d1ebd990873a71b67c70fce83aa4a1c4c9ce99fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
#   licensed under the Affero General Public License version 3 or later.  See
#   the COPYRIGHT file.

describe Workers::Mail::Reshared do
  describe "#perform" do
    it "should call .deliver on the notifier object" do
      sm = FactoryGirl.build(:status_message, :author => bob.person, :public => true)
      reshare = FactoryGirl.build(:reshare, :author => alice.person, :root=> sm)

      mail_double = double()
      expect(mail_double).to receive(:deliver_now)
      expect(Notifier).to receive(:send_notification)
        .with("reshared", bob.id, reshare.author.id, reshare.id).and_return(mail_double)

      Workers::Mail::Reshared.new.perform(bob.id, reshare.author.id, reshare.id)
    end
  end
end