Commit 7d02c2abe894950a9aadfcd712fd20b9828e7785
1 parent
7acb7819
Exists in
master
and in
18 other branches
Updated pattern [skip ci]
Showing
1 changed file
with
7 additions
and
6 deletions
Show diff stats
test/test_helper.rb
@@ -579,14 +579,15 @@ class Minitest::Test | @@ -579,14 +579,15 @@ class Minitest::Test | ||
579 | assert_equal expected, klass.search(term, options).map(&:name).first | 579 | assert_equal expected, klass.search(term, options).map(&:name).first |
580 | end | 580 | end |
581 | 581 | ||
582 | - def with_options(model, options) | ||
583 | - previous_options = model.searchkick_options.dup | 582 | + def with_options(klass, options) |
583 | + previous_options = klass.searchkick_options.dup | ||
584 | begin | 584 | begin |
585 | - model.searchkick_options.merge!(options) | ||
586 | - model.reindex | 585 | + klass.searchkick_options.merge!(options) |
586 | + klass.reindex | ||
587 | + yield | ||
587 | ensure | 588 | ensure |
588 | - model.searchkick_options.clear | ||
589 | - model.searchkick_options.merge!(previous_options) | 589 | + klass.searchkick_options.clear |
590 | + klass.searchkick_options.merge!(previous_options) | ||
590 | end | 591 | end |
591 | end | 592 | end |
592 | end | 593 | end |