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
The response_data helper is really nice, but since it uses add_helper, it's memoized. This is problematic because it's not memoized based on the arguments provided. If you use it multiple times in 1 spec, the subsequent calls don't return what you'd expect.
To work around this, we've added the following to our RSpec config to undo the memoization:
fix_response_data=Module.newdodefresponse_data(*)raise'Make sure this is still necessary'unlessRSpec::GraphQLResponse::VERSION == '0.5.0'remove_instance_variable(:@response_data)ifinstance_variable_defined?(:@response_data)superendendconfig.prependfix_response_data,type: :graphql
The text was updated successfully, but these errors were encountered:
The response_data helper is really nice, but since it uses
add_helper
, it's memoized. This is problematic because it's not memoized based on the arguments provided. If you use it multiple times in 1 spec, the subsequent calls don't return what you'd expect.To work around this, we've added the following to our RSpec config to undo the memoization:
The text was updated successfully, but these errors were encountered: