Displaying 2 results from an estimated 2 matches for "shared_examples".
2010 Mar 18
1
shared_example can't have the same name even if defined it different specs
I am writing some specs related to permissions for different kinds of
users. Every user has some common examples to test in many different
specs. For example, all users can view, and edit their profile.
Also, all users can view their own "history." So I have two spec
files, say profile_controller_spec and history_controller_spec.
They might look like http://gist.github.com/336898
2011 Aug 05
5
named context or calling include_context with block?
Hello,
I''m playing around with Rspec again after going from test/unit to
rspec then back to test/unit... :) Right off the bat, I find myself
wanting to do something like this: https://gist.github.com/1128091
Basically, I want to name a context, then call it later by name,
passing a block to it.
Or in other words... what is the best way to DRY this code?