Created
March 28, 2019 10:10
-
-
Save MaryKuz/ccdb01c52a0687612e2873784de1fb4b to your computer and use it in GitHub Desktop.
Correct the tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe '.search_by' do | |
let(:relation) { double } | |
before { expect(Product).to receive(:page).with(1).and_return(relation) } | |
context do | |
it { expect { Product.search_by 'page' => 1 }.to_not raise_error } | |
end | |
context do | |
before { expect(relation).to receive(:where).with('name ILIKE ?', 'abc%') } | |
it { expect { Product.search_by 'page' => 1, 'term' => 'abc' }.to_not raise_error } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment