You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i try to upgrade to Rails 7.1 from Rails 6.0, i get some errors in my specs, i found for some reason when i use build_stubbed in validations, it don't work properly.
Reproduction Steps
I just runned my specs and for some reason this broke:
context"validations"doit{is_expected.to(validate_presence_of(:product_id))}it"validate uniqueness of product_id"dovalid_seasonality_item=create(:seasonality_item)invalid_seasonality_item=build_stubbed(:seasonality_item,product: valid_seasonality_item.product,seasonality: valid_seasonality_item.seasonality,)invalid_seasonality_item.valid?expect(invalid_seasonality_item.errors&.first&.attribute).to(eq(:product_id))endend
idk, for some reason this dont work, is expected to the invalid_seasonality_item to be invalid, but, its valid in this tests, so, i just changed the build_stubbed for build and thats works
Expected behavior
I want some response about what happened with build_stubbed and a solution for that
Actual behavior
At the moment, my specs with build_stubbed are broke.
Description
When i try to upgrade to Rails 7.1 from Rails 6.0, i get some errors in my specs, i found for some reason when i use build_stubbed in validations, it don't work properly.
Reproduction Steps
I just runned my specs and for some reason this broke:
idk, for some reason this dont work, is expected to the invalid_seasonality_item to be invalid, but, its valid in this tests, so, i just changed the
build_stubbed
forbuild
and thats worksExpected behavior
I want some response about what happened with build_stubbed and a solution for that
Actual behavior
At the moment, my specs with build_stubbed are broke.
System configuration
factory_bot version:
"factory_bot_rails", "~> 6.4.0"
rails version:
"rails", "~> 7.1.3"
ruby version:
ruby 3.3.0
The text was updated successfully, but these errors were encountered: