* Dropped all references to Resque * Moved all jobs under app/workers since that's the Sidekiq convention * Renamed Jobs module to Worker to match new location * Adapted all jobs to Sidekiq * Replaced all enqueue calls with perform_async * Dropped Resque hacks from specs and features, replaced with sidekig/testing in RSpec and sidekig/testing/inline in Cucumber * Updated scripts to start a Sidekiq server * Inline Sidekiq sinatra app * Let Sidekiq create the actual Redis instance * Workaround already initialized constant warnings in service models * Resolved ToDo in one job definition by creating proper exception clases for some errors in receiving posts * Added sidekiq section to configuration to make it completly configurable to the user * Add Sidekiq middleware for clean backtraces * Delay HttpMulti retry to give offline pods a chance to come back up * Do not retry on GUID already taken and alike errors * Be graceful about deleted posts in GatherOEmbedData
15 lines
515 B
Ruby
15 lines
515 B
Ruby
require 'spec_helper'
|
|
|
|
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)
|
|
User.stub!(:find_by_id).with(user.id.to_s).and_return(user)
|
|
m = mock()
|
|
url = "foobar"
|
|
m.should_receive(:post).with(anything, url)
|
|
Service.stub!(:find_by_id).and_return(m)
|
|
Workers::PostToService.new.perform("123", post.id.to_s, url)
|
|
end
|
|
end
|