Commit d5312b89af4d6bb0c2a7abdcad46b88c2353dcf8

Authored by Andrew Kane
1 parent 5979937e

Fixed test code

test/index_options_test.rb
... ... @@ -3,7 +3,6 @@ require_relative "test_helper"
3 3 class IndexOptionsTest < Minitest::Test
4 4 def setup
5 5 Song.destroy_all
6   - Song.instance_variable_set(:@searchkick_index_name, nil)
7 6 end
8 7  
9 8 def test_case_sensitive
... ...
test/support/helpers.rb
... ... @@ -83,10 +83,12 @@ class Minitest::Test
83 83 def with_options(options, model = default_model)
84 84 previous_options = model.searchkick_options.dup
85 85 begin
  86 + model.instance_variable_set(:@searchkick_index_name, nil)
86 87 model.searchkick_options.merge!(options)
87 88 model.reindex
88 89 yield
89 90 ensure
  91 + model.instance_variable_set(:@searchkick_index_name, nil)
90 92 model.searchkick_options.clear
91 93 model.searchkick_options.merge!(previous_options)
92 94 end
... ...