Commit 31780ddac7a89eab1e0552a32b403f2040a37931

Authored by Andrew Kane
1 parent 7c7ed2c5

Updated test examples [skip ci]

Showing 1 changed file with 8 additions and 6 deletions   Show diff stats
README.md
... ... @@ -1696,10 +1696,11 @@ For performance, only enable Searchkick callbacks for the tests that need it.
1696 1696 Add to your `test/test_helper.rb`:
1697 1697  
1698 1698 ```ruby
1699   -Searchkick.disable_callbacks
1700   -
1701   -# and reindex models
  1699 +# reindex models
1702 1700 Product.reindex
  1701 +
  1702 +# and disable callbacks
  1703 +Searchkick.disable_callbacks
1703 1704 ```
1704 1705  
1705 1706 And use:
... ... @@ -1729,10 +1730,11 @@ Add to your `spec/spec_helper.rb`:
1729 1730 ```ruby
1730 1731 RSpec.configure do |config|
1731 1732 config.before(:suite) do
1732   - Searchkick.disable_callbacks
1733   -
1734   - # and reindex models
  1733 + # reindex models
1735 1734 Product.reindex
  1735 +
  1736 + # and disable callbacks
  1737 + Searchkick.disable_callbacks
1736 1738 end
1737 1739  
1738 1740 config.around(:each, search: true) do |example|
... ...