Skip to content

Commit

Permalink
Add reindex trait to rubygems & version factories
Browse files Browse the repository at this point in the history
  • Loading branch information
colby-swandale committed Oct 9, 2024
1 parent c86e1c1 commit 9324a77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/factories/rubygem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

name

trait :reindex do
after(:create) do |rubygem, _evaluator|
rubygem.reindex(refresh: true)
end
end

after(:build) do |rubygem, evaluator|
if evaluator.linkset
rubygem.linkset = evaluator.linkset
Expand Down
6 changes: 6 additions & 0 deletions test/factories/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
sha256 { "tdQEXD9Gb6kf4sxqvnkjKhpXzfEE96JucW4KHieJ33g=" }
spec_sha256 { Digest::SHA2.base64digest("#{rubygem.name}-#{number}-#{platform}") }

trait :reindex do
after(:create) do |version|
version.rubygem.reindex(refresh: true)
end
end

trait :yanked do
indexed { false }
end
Expand Down

0 comments on commit 9324a77

Please sign in to comment.