Skip to content

Commit

Permalink
Use count(:all) in specs
Browse files Browse the repository at this point in the history
Due to Rails pull request #10710, count without a parameter and empty? don't work with a pg_search relation.

rails/rails#10710
  • Loading branch information
nertzy committed Jan 5, 2014
1 parent e45267f commit 4b4ba21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/integration/pg_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
ModelWithPgSearch.create!(:content => 'bar')

results = ModelWithPgSearch.search_content('foo')
expect(results.count).to eq 1
expect(results.count(:all)).to eq 1
end

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

# matches tsearch only
Expand Down

0 comments on commit 4b4ba21

Please sign in to comment.