spec/lib/query/combination_spec.rb in picky-3.4.3 vs spec/lib/query/combination_spec.rb in picky-3.5.0
- old
+ new
@@ -9,19 +9,19 @@
@token = Picky::Query::Token.processed('some_text~', 'Some Original~')
@category = stub :category, :bundle_for => @bundle, :name => :some_category_name
@combination = described_class.new @token, @category
end
-
+
describe "to_s" do
it "shows the combination's info" do
@token.stub! :to_result => :token_result
-
+
@combination.to_s.should == 'bundle_name some_category_name:token_result'
end
end
-
+
describe 'hash' do
it 'should hash the token and the bundle' do
@combination.hash.should == [@token.to_s, @bundle].hash
end
end
@@ -32,11 +32,11 @@
token = Picky::Query::Token.processed 'name:blä~', 'Blä~'
@combination = Picky::Query::Combination.new token, @category
end
it 'should return a correct result' do
- @combination.to_result.should == [:some_category_name, 'Blä~', :blä] # Note: Characters not substituted. That's ok.
+ @combination.to_result.should == [:some_category_name, 'Blä~', 'blä'] # Note: Characters not substituted. That's ok.
end
end
it 'should return a correct result' do
@token.stub! :to_result => [:some_original_text, :some_text]
@@ -50,11 +50,11 @@
end
end
describe 'ids' do
it 'should call ids with the text on bundle' do
- @bundle.should_receive(:ids).once.with :some_text
+ @bundle.should_receive(:ids).once.with 'some_text'
@combination.ids
end
it 'should not call it twice, but cache' do
@bundle.stub! :ids => :some_ids
@@ -66,10 +66,10 @@
end
end
describe 'weight' do
it 'should call weight with the text on bundle' do
- @bundle.should_receive(:weight).once.with :some_text
+ @bundle.should_receive(:weight).once.with 'some_text'
@combination.weight
end
it 'should not call it twice, but cache' do
@bundle.stub! :weight => :some_weight
\ No newline at end of file