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
Hey :)
Using this gem we noticed that having predictable data in different run can be useful if you are going to regenerate the OpenAPI documentation (fully or partially).
To achieve this goal we are using this configuration block:
ifENV['OPENAPI'].present?seed=ENV.fetch('OPENAPI_SEED',0xFFFF)srand(seed)Faker::Config.random=Random.new(seed)ifdefined?FakerRSpec.configuredo |config|
config.order=:definedconfig.beforedoallow(Devise).toreceive(:friendly_token){('A'..'Z').to_a.sample(20).join}ifdefined?DeviseActiveRecord::Base.connection.tables.eachdo |t|
# to preserve IDsActiveRecord::Base.connection.reset_pk_sequence!(t)endendconfig.includeActiveSupport::Testing::TimeHelpersconfig.arounddo |example|
time=Time.zone.local(2022,10,15,12,34,56)travel_to(time)# to preserve dates & timesexample.runtravel_backendendend
Perhaps these kind of options shouldn't be included in the gem (they are configuration) but they could be useful in the README to help others.
WDYT?
The text was updated successfully, but these errors were encountered:
Hey :)
Using this gem we noticed that having predictable data in different run can be useful if you are going to regenerate the OpenAPI documentation (fully or partially).
To achieve this goal we are using this configuration block:
Perhaps these kind of options shouldn't be included in the gem (they are configuration) but they could be useful in the README to help others.
WDYT?
The text was updated successfully, but these errors were encountered: