-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
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.new do
def response_data(*)
raise 'Make sure this is still necessary' unless RSpec::GraphQLResponse::VERSION == '0.5.0'
remove_instance_variable(:@response_data) if instance_variable_defined?(:@response_data)
super
end
end
config.prepend fix_response_data, type: :graphqlvolpejoaquin, callahat, hedselu and zernie
Metadata
Metadata
Assignees
Labels
No labels