[rspec-users] response.should_not redirect_to
Yurii Rashkovskii
yrashk at gmail.com
Thu Jul 26 19:26:28 EDT 2007
Hey,
May be it is just too deep night over here and I'm missing something
though I got this failure on {{{response.should_not redirect_to}}}:
'QueuesController should allow authenticated user to access 'show''
FAILED
Matcher does not support should_not.
See Spec::Matchers for more information
about matchers.
Also I've found this in rspec_on_rails sources:
# response.should_not redirect_to(url)
# response.should_not redirect_to(:action => action_name)
# response.should_not redirect_to(:controller =>
controller_name, :action => action_name)
So, am I really missing something important?
I've added negative_failure_message to RedirectTo matcher and it
seems to function just fine (though as I've stated, it's quite late
over here, so I could be wrong)
class Spec::Rails::Matchers::RedirectTo
def negative_failure_message
return %Q{expected to not to be redirected to #
{@expected.inspect}, but actually was redirected there} if @redirected
end
end
Any ideas?
More information about the rspec-users
mailing list