Skip to content

Commit 048b1e4

Browse files
committed
Use count(:all) in specs
Due to Rails pull request #10710, count without a parameter and empty? don't work with a pg_search relation. rails/rails#10710
1 parent 5b3f5a7 commit 048b1e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/integration/pg_search_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
ModelWithPgSearch.create!(:content => 'bar')
157157

158158
results = ModelWithPgSearch.search_content('foo')
159-
expect(results.count).to eq 1
159+
expect(results.count(:all)).to eq 1
160160
end
161161

162162
it "returns rows where the column contains all the terms in the query in any order" do
@@ -629,7 +629,7 @@
629629
ModelWithPgSearch.with_trigram(accent_query).should_not include(record)
630630
ModelWithPgSearch.with_trigram_and_ignoring_accents(accent_query).should include(record)
631631
ModelWithPgSearch.with_tsearch(accent_query).should_not include(record)
632-
ModelWithPgSearch.with_tsearch_and_trigram(accent_query).should be_empty
632+
ModelWithPgSearch.with_tsearch_and_trigram(accent_query).count(:all).should == 0
633633
ModelWithPgSearch.complex_search(accent_query).should include(record)
634634

635635
# matches tsearch only

0 commit comments

Comments
 (0)