Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1865 by memoizing generated method name. #1872

Merged
merged 1 commit into from Sep 14, 2017

Conversation

fables-tales
Copy link
Member

The problem here is that rails calls #method_name on the example a
number of times in order to correctly generate the screenshot and then
manipulate it. Given that we were randomising the integer that was
generated on every call, this didn't work.

This patch solves the problem by memoizing the generated method name so
that the screenshot path is generated once per example and then
correctly accessed on subsequent method calls.

The problem here is that rails calls `#method_name` on the example a
number of times in order to correctly generate the screenshot and then
manipulate it. Given that we were randomising the integer that was
generated on every call, this didn't work.

This patch solves the problem by memoizing the generated method name so
that the screenshot path is generated once per example and then
correctly accessed on subsequent method calls.
@fables-tales fables-tales merged commit 584d04c into master Sep 14, 2017
@fables-tales fables-tales deleted the fix-system-test-screenshots branch September 14, 2017 19:18
11factory pushed a commit to 11factory/rspec-rails that referenced this pull request Oct 18, 2017
The problem here is that rails calls `#method_name` on the example a
number of times in order to correctly generate the screenshot and then
manipulate it. Given that we were randomising the integer that was
generated on every call, this didn't work.

This patch solves the problem by memoizing the generated method name so
that the screenshot path is generated once per example and then
correctly accessed on subsequent method calls.
sebjacobs pushed a commit to futurelearn/rspec-rails that referenced this pull request Mar 15, 2019
The problem here is that rails calls `#method_name` on the example a
number of times in order to correctly generate the screenshot and then
manipulate it. Given that we were randomising the integer that was
generated on every call, this didn't work.

This patch solves the problem by memoizing the generated method name so
that the screenshot path is generated once per example and then
correctly accessed on subsequent method calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant