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

post_to_service_spec.rb « workers « spec - github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a4370b81fe26ae77a590e6a9eb18c308412297b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
describe Workers::PostToService do
  it 'calls service#post with the given service' do
    user = alice
    aspect = user.aspects.create(:name => "yeah")
    post = user.post(:status_message, :text => 'foo', :to => aspect.id)
    allow(User).to receive(:find_by_id).with(user.id.to_s).and_return(user)
    m = double()
    url = "foobar"
    expect(m).to receive(:post).with(anything, url)
    allow(Service).to receive(:find_by_id).and_return(m)
    Workers::PostToService.new.perform("123", post.id.to_s, url)
  end
end