tests: fix null uploader_ip_addr exceptions in create(:post).
Caused by a change in FactoryBot 5. Associations in factories are now constructed using the same strategy as the base object, meaning that using `build` to construct an object will also construct the associations using `build`. This meant that overriding `create` to do `build` + `save` broke the way that associations were constructed. https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#associations
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
FactoryBot.define do
|
||||
factory(:user, aliases: [:creator, :updater]) do
|
||||
factory(:user, aliases: [:creator, :updater, :uploader]) do
|
||||
sequence :name do |n|
|
||||
"user#{n}"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user