Created
March 28, 2019 10:01
-
-
Save MaryKuz/6971c6c574593e29f0ee3db15e9066e6 to your computer and use it in GitHub Desktop.
Correct spec/controllers/api/products_controller_spec.rb 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
RSpec.describe Api::ProductsController, type: :controller do | |
.... | |
describe '#collection' do | |
before { expect(subject).to receive(:params).and_return(:params) } | |
before { expect(Product).to receive(:search_by).with(params) } | |
it { expect { subject.send :collection }.to_not raise_error } | |
end | |
.... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment