Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

This library wants a string, flying-sphinx wants an array.

  • Loading branch information...
commit 9f9a321fe7c3f21bd5bfc00b575904dcbc1dabd1 1 parent 2460070
@pat pat authored
View
4 lib/flying_sphinx/resque_delta/delta_job.rb
@@ -1,6 +1,6 @@
class FlyingSphinx::ResqueDelta::DeltaJob < ThinkingSphinx::Deltas::ResqueDelta::DeltaJob
@queue = :fs_delta
-
+
# Runs Sphinx's indexer tool to process the index. Currently assumes Sphinx
# is running.
#
@@ -9,6 +9,6 @@ class FlyingSphinx::ResqueDelta::DeltaJob < ThinkingSphinx::Deltas::ResqueDelta:
def self.perform(indices)
return if skip?(indices)
- FlyingSphinx::IndexRequest.new(indices).perform
+ FlyingSphinx::IndexRequest.new([indices]).perform
end
end
View
16 spec/flying_sphinx/resque_delta/delta_job_spec.rb
@@ -7,26 +7,26 @@
should == :fs_delta
end
end
-
+
describe '.perform' do
it "doesn't create an index request when skipping" do
FlyingSphinx::ResqueDelta::DeltaJob.stub!(:skip? => true)
-
+
FlyingSphinx::IndexRequest.should_not_receive(:new)
-
- FlyingSphinx::ResqueDelta::DeltaJob.perform ['foo_delta']
+
+ FlyingSphinx::ResqueDelta::DeltaJob.perform 'foo_delta'
end
-
+
it "performs an index request when not skipping" do
request = double('index request', :perform => true)
FlyingSphinx::ResqueDelta::DeltaJob.stub!(:skip? => false)
-
+
FlyingSphinx::IndexRequest.should_receive(:new).
with(['foo_delta']).
and_return(request)
request.should_receive(:perform)
-
- FlyingSphinx::ResqueDelta::DeltaJob.perform ['foo_delta']
+
+ FlyingSphinx::ResqueDelta::DeltaJob.perform 'foo_delta'
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.