Re: [rspec-users] Make macros DRY

2010-12-22 Thread rejeep
Thanks for your reply David! My solution ended up something like this: def it_should_grant_access(role, options) request_index = proc do get :index response.success? end # ... actions_from(options).each do |action| request = instance_eval(&eval("request_#{ac

Re: [rspec-users] Make macros DRY

2010-12-21 Thread David Chelimsky
On Dec 21, 2010, at 2:11 PM, rejeep wrote: > Hey, > > I have lots of problems to refactor RSpec macros and make them DRY. > Right now I'm stuck in such a situation for some role macros. > > In my controller tests, I want to write: > > 1) it_should_grant_access(:super_admin, :to => :countries)