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
Like many, I use the same factory with multiple strategies, based on the individual test.
Critically, I want the same code executed on completion, regardless of the strategy used.
With :create also calling :build I need to determine in the :after_build callback if I should execute the code or not.
The strategy can be found with context.instance_variable_get(:@build_strategy).to_sym, but that required a degree of familiarity with the code that most users won't have.
Desired solution
A helper method for the context would simplify the whole process:
Problem this feature will solve
Like many, I use the same factory with multiple strategies, based on the individual test.
Critically, I want the same code executed on completion, regardless of the strategy used.
With :create also calling :build I need to determine in the :after_build callback if I should execute the code or not.
The strategy can be found with
context.instance_variable_get(:@build_strategy).to_sym
, but that required a degree of familiarity with the code that most users won't have.Desired solution
A helper method for the context would simplify the whole process:
Additional context
I'll do a pull request for this feature.
The text was updated successfully, but these errors were encountered: