Permalink
Browse files

- to_json methods

  • Loading branch information...
1 parent 4633457 commit ef89c47ad169b414efba364f5ad43f948f79300f @floere committed Mar 1, 2013
Showing with 0 additions and 30 deletions.
  1. +0 −8 server/lib/picky/query/allocation.rb
  2. +0 −22 server/spec/lib/query/allocation_spec.rb
@@ -105,14 +105,6 @@ def <=> other_allocation
def to_result
[self.result_identifier, self.score, self.count, @combinations.to_result, self.ids] if self.count && self.count > 0
end
-
- # Json representation of this allocation.
- #
- # Note: Forwards to to_result.
- #
- def to_json options = {}
- MultiJson.encode to_result, options
- end
#
#
@@ -9,14 +9,6 @@
@allocation = described_class.new @index, @combinations
end
- # describe "hash" do
- # it "forwards to the combinations" do
- # @combinations.should_receive(:hash).once.with
- #
- # @allocation.hash
- # end
- # end
-
describe "to_s" do
before(:each) do
@combinations.stub! :to_result => 'combinations_result'
@@ -189,20 +181,6 @@
end
end
- describe 'to_json' do
- before(:each) do
- @allocation = described_class.new @index, stub(:combination, :empty? => false, :to_result => [:some_result1, :some_result2])
- @allocation.instance_variable_set :@score, :some_score
- end
- it 'should output the correct json string' do
- @backend.stub! :ids => [1,2,3,4,5,6,7]
-
- @allocation.process! 20, 0
-
- @allocation.to_json.should == '["some_result_identifier","some_score",7,["some_result1","some_result2"],[1,2,3,4,5,6,7]]'
- end
- end
-
describe "calculate_score" do
context 'non-empty combinations' do
it 'should forward to backend and combinations' do

0 comments on commit ef89c47

Please sign in to comment.