Commit d5312b89af4d6bb0c2a7abdcad46b88c2353dcf8
1 parent
5979937e
Exists in
master
and in
2 other branches
Fixed test code
Showing
2 changed files
with
2 additions
and
1 deletions
Show diff stats
test/index_options_test.rb
@@ -3,7 +3,6 @@ require_relative "test_helper" | @@ -3,7 +3,6 @@ require_relative "test_helper" | ||
3 | class IndexOptionsTest < Minitest::Test | 3 | class IndexOptionsTest < Minitest::Test |
4 | def setup | 4 | def setup |
5 | Song.destroy_all | 5 | Song.destroy_all |
6 | - Song.instance_variable_set(:@searchkick_index_name, nil) | ||
7 | end | 6 | end |
8 | 7 | ||
9 | def test_case_sensitive | 8 | def test_case_sensitive |
test/support/helpers.rb
@@ -83,10 +83,12 @@ class Minitest::Test | @@ -83,10 +83,12 @@ class Minitest::Test | ||
83 | def with_options(options, model = default_model) | 83 | def with_options(options, model = default_model) |
84 | previous_options = model.searchkick_options.dup | 84 | previous_options = model.searchkick_options.dup |
85 | begin | 85 | begin |
86 | + model.instance_variable_set(:@searchkick_index_name, nil) | ||
86 | model.searchkick_options.merge!(options) | 87 | model.searchkick_options.merge!(options) |
87 | model.reindex | 88 | model.reindex |
88 | yield | 89 | yield |
89 | ensure | 90 | ensure |
91 | + model.instance_variable_set(:@searchkick_index_name, nil) | ||
90 | model.searchkick_options.clear | 92 | model.searchkick_options.clear |
91 | model.searchkick_options.merge!(previous_options) | 93 | model.searchkick_options.merge!(previous_options) |
92 | end | 94 | end |