Skip to content

Commit

Permalink
Make with_tracks trait work when building albums
Browse files Browse the repository at this point in the history
  • Loading branch information
floehopper committed Jan 16, 2024
1 parent d3f9a2e commit e9c5763
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/factories/album.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
number_of_tracks { 2 }
end

after(:create) do |album, evaluator|
create_list(:track, evaluator.number_of_tracks, album:)
album.reload
after(:build) do |album, evaluator|
album.tracks = build_list(:track, evaluator.number_of_tracks, album:)
end
end
end
Expand Down

0 comments on commit e9c5763

Please sign in to comment.