Looking for help with testing scopes DRY

12 views
Skip to first unread message

Alexander Kireyev

unread,
Sep 6, 2014, 1:38:33 AM9/6/14
to rs...@googlegroups.com
I asked a question on SO would be great if someone could help. Briefly, I want to test scopes for all controller actions at once, not repeating code for each action. I couldn't find any attempts with this problem, maybe it's impossible.

Jon Rowe

unread,
Sep 6, 2014, 8:02:58 PM9/6/14
to rs...@googlegroups.com
I’m not entirely sure what you’re asking here, but if you want to repeat tests / setup for multiple controller actions then your best bet is to define and use shared_examples, see: https://www.relishapp.com/rspec/rspec-core/docs/example-groups/shared-examples for further details

Jon Rowe
---------------------------

On Saturday, 6 September 2014 at 15:38, Alexander Kireyev wrote:

I asked a question on SO would be great if someone could help. Briefly, I want to test scopes for all controller actions at once, not repeating code for each action. I couldn't find any attempts with this problem, maybe it's impossible.

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/f9b0f517-2946-433a-a63d-1a3af4eb69ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages