[rspec-users] help on skipping a before_filter for a story

Eric Harris-Braun eric at harris-braun.com
Mon Sep 8 20:33:56 EDT 2008

Hi folks,

I'm hoping for a bit of help on best-practices for skipping a
before_filter when running a particular step.  Specifically the
authentication filter.  What happens is that the post (see code below)
returns a redirect response to the login page triggered by the of my
authentication filter, rather than the contents of what I'd like to be

How do people handle temporarily turning of this kind of thing that's
not relevant to the test?  Temporarily I've just put an unless RAILS_ENV
== 'test' after it, but obviouly that won't work for the specs that
actually test that before filter!

Thanks for any help!


  Given "$field in new entry is $field_value" do |field,field_value|
    @params ||= {}
    @params[field.intern] = field_value

  When "submitting the new entry" do
    post "/entry", :record => @params

  Then "should include confirmation: $message" do |message|
    response.should have_text(/#{message}/)
He who is content with his lot probably has a lot.

More information about the rspec-users mailing list