Skip to content

Commit d582b98

Browse files
committed
Make test reset helpers async
Unnecessary awaits should be avoided, generally these methods are meant to be called at the beginning of the test and for best performance we should wait on tasks right before an assertion.
1 parent 5450df2 commit d582b98

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

spec/support/models/animals.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def ms_id
3434

3535
module TestUtil
3636
def self.reset_animals!
37-
Cat.clear_index!(true)
37+
Cat.clear_index!
3838
Cat.delete_all
39-
Dog.clear_index!(true)
39+
Dog.clear_index!
4040
Dog.delete_all
4141
end
4242
end

spec/support/models/book.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def public?
3535

3636
module TestUtil
3737
def self.reset_books!
38-
Book.clear_index!(true)
38+
Book.clear_index!
3939
Book.index(safe_index_uid('BookAuthor')).delete_all_documents
4040
Book.index(safe_index_uid('Book')).delete_all_documents
4141
end

spec/support/models/color.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def will_save_change_to_short_name?
3939

4040
module TestUtil
4141
def self.reset_colors!
42-
Color.clear_index!(true)
42+
Color.clear_index!
4343
Color.delete_all
4444
end
4545
end

spec/support/models/movie.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Movie < ActiveRecord::Base
1515

1616
module TestUtil
1717
def self.reset_movies!
18-
Movie.clear_index!(true)
18+
Movie.clear_index!
1919
Movie.delete_all
2020
end
2121
end

spec/support/models/people.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def will_save_change_to_full_name?
2525

2626
module TestUtil
2727
def self.reset_people!
28-
People.clear_index!(true)
28+
People.clear_index!
2929
People.delete_all
3030
end
3131
end

0 commit comments

Comments
 (0)