Commit 5c4874e4231034f2c660c703cc3d8711604007d3
1 parent
5a08dcd2
Exists in
master
and in
21 other branches
Fixed tests
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
test/reindex_job_test.rb
... | ... | @@ -12,20 +12,20 @@ class TestReindexJob < Minitest::Test |
12 | 12 | end |
13 | 13 | |
14 | 14 | def test_create |
15 | - Product.create!(id: 1, name: "Boom") | |
15 | + product = Product.create!(name: "Boom") | |
16 | 16 | Product.searchkick_index.refresh |
17 | 17 | assert_search "*", [] |
18 | - Searchkick::ReindexJob.new("Product", 1).perform | |
18 | + Searchkick::ReindexJob.new("Product", product.id).perform | |
19 | 19 | Product.searchkick_index.refresh |
20 | 20 | assert_search "*", ["Boom"] |
21 | 21 | end |
22 | 22 | |
23 | 23 | def test_destroy |
24 | - product = Product.create!(id: 1, name: "Boom") | |
24 | + product = Product.create!(name: "Boom") | |
25 | 25 | Product.reindex |
26 | 26 | assert_search "*", ["Boom"] |
27 | 27 | product.destroy |
28 | - Searchkick::ReindexJob.new("Product", 1).perform | |
28 | + Searchkick::ReindexJob.new("Product", product.id).perform | |
29 | 29 | Product.searchkick_index.refresh |
30 | 30 | assert_search "*", [] |
31 | 31 | end | ... | ... |
test/test_helper.rb
... | ... | @@ -6,7 +6,7 @@ require "logger" |
6 | 6 | |
7 | 7 | ENV["RACK_ENV"] = "test" |
8 | 8 | |
9 | -Minitest::Test = Minitest::Test unless defined?(Minitest::Test) | |
9 | +Minitest::Test = Minitest::Unit::TestCase unless defined?(Minitest::Test) | |
10 | 10 | |
11 | 11 | File.delete("elasticsearch.log") if File.exists?("elasticsearch.log") |
12 | 12 | Searchkick.client.transport.logger = Logger.new("elasticsearch.log") | ... | ... |