spec/acceptance/association_scoping_spec.rb in thinking-sphinx-3.2.0 vs spec/acceptance/association_scoping_spec.rb in thinking-sphinx-3.3.0
- old
+ new
@@ -7,21 +7,21 @@
melbourne = Article.create :title => 'Guide to Melbourne', :user => pat
paul = User.create :name => 'Paul'
dublin = Article.create :title => 'Guide to Dublin', :user => paul
index
- pat.articles.search('Guide').to_a.should == [melbourne]
+ expect(pat.articles.search('Guide').to_a).to eq([melbourne])
end
it "limits id-only results to those matching the foreign key" do
pat = User.create :name => 'Pat'
melbourne = Article.create :title => 'Guide to Melbourne', :user => pat
paul = User.create :name => 'Paul'
dublin = Article.create :title => 'Guide to Dublin', :user => paul
index
- pat.articles.search_for_ids('Guide').to_a.should == [melbourne.id]
+ expect(pat.articles.search_for_ids('Guide').to_a).to eq([melbourne.id])
end
end
describe 'for real-time indices' do
it "limits results to those matching the foreign key" do
@@ -29,21 +29,21 @@
spyder = Car.create :name => '918 Spyder', :manufacturer => porsche
audi = Manufacturer.create :name => 'Audi'
r_eight = Car.create :name => 'R8 Spyder', :manufacturer => audi
- porsche.cars.search('Spyder').to_a.should == [spyder]
+ expect(porsche.cars.search('Spyder').to_a).to eq([spyder])
end
it "limits id-only results to those matching the foreign key" do
porsche = Manufacturer.create :name => 'Porsche'
spyder = Car.create :name => '918 Spyder', :manufacturer => porsche
audi = Manufacturer.create :name => 'Audi'
r_eight = Car.create :name => 'R8 Spyder', :manufacturer => audi
- porsche.cars.search_for_ids('Spyder').to_a.should == [spyder.id]
+ expect(porsche.cars.search_for_ids('Spyder').to_a).to eq([spyder.id])
end
end
describe 'with has_many :through associations' do
it 'limits results to those matching the foreign key' do
@@ -55,9 +55,9 @@
pancakes.categories << food
pancakes.categories << flat
waffles.categories << food
- flat.products.search('Low').to_a.should == [pancakes]
+ expect(flat.products.search('Low').to_a).to eq([pancakes])
end
end
end