Allow setting current resource in tests#149
Conversation
| controller = context[:controller] | ||
| resource_names = Array(context[:resource_name]) | ||
|
|
||
| if context[:current_resource].blank? |
There was a problem hiding this comment.
Why not the shorter version?
context[:current_resource] ||= resource_names.find do |resource_name|
mcelicalderon
left a comment
There was a problem hiding this comment.
Looks good, just a small suggestion and don't forget to remove commented code.
|
This is super cool -- I see that its closed now but is there a way for new users of the gem to know about how to properly test? Maybe a readme section could be added show the methods included in this PR, or at least a link from readme to the above? |
|
Hi @keithmgould , I think that is a great suggestion! |
|
I can also do that if no one has done it until I get some time. Important thing to note here is that this is a quick fix that works for all but one scenario, passing no |
Allows setting
current_resourceon specs usingwith graphql schema testshared contextCloses #138