spec/ransack_spec.rb in nql-0.0.2 vs spec/ransack_spec.rb in nql-0.0.3
- old
+ new
@@ -53,11 +53,11 @@
q[:c][0].should have_predicate 'lteq'
q[:c][0].should have_value '1234'
end
it 'Contains' do
- q = parser.parse('id % 1234').to_ransack
+ q = parser.parse('id : 1234').to_ransack
q[:c][0].should have_attribute 'id'
q[:c][0].should have_predicate 'cont'
q[:c][0].should have_value '1234'
end
@@ -85,11 +85,11 @@
q[:g][0][:c][1].should have_predicate 'eq'
q[:g][0][:c][1].should have_value 'abcd'
end
it 'Or' do
- q = parser.parse('id < 1234 | name % abcd').to_ransack
+ q = parser.parse('id < 1234 | name : abcd').to_ransack
q[:g][0][:m].should eq 'or'
q[:g][0][:c][0].should have_attribute 'id'
q[:g][0][:c][0].should have_predicate 'lt'
q[:g][0][:c][0].should have_value '1234'
@@ -97,11 +97,11 @@
q[:g][0][:c][1].should have_predicate 'cont'
q[:g][0][:c][1].should have_value 'abcd'
end
it 'And then Or' do
- q = parser.parse('id > 1234 & name = abcd | name % efgh').to_ransack
+ q = parser.parse('id > 1234 & name = abcd | name : efgh').to_ransack
q[:g][0][:m].should eq 'and'
q[:g][0][:c][0].should have_attribute 'id'
q[:g][0][:c][0].should have_predicate 'gt'
q[:g][0][:c][0].should have_value '1234'
@@ -113,10 +113,10 @@
q[:g][0][:g][0][:c][1].should have_predicate 'cont'
q[:g][0][:g][0][:c][1].should have_value 'efgh'
end
it 'With parentheses' do
- q = parser.parse('(id > 1234 & name = abcd) | name % efgh').to_ransack
+ q = parser.parse('(id > 1234 & name = abcd) | name : efgh').to_ransack
q[:g][0][:g][0][:m].should eq 'and'
q[:g][0][:g][0][:c][0].should have_attribute 'id'
q[:g][0][:g][0][:c][0].should have_predicate 'gt'
q[:g][0][:g][0][:c][0].should have_value '1234'
\ No newline at end of file