#9 √ resolved
Mark Dodwell

Follow redirect after POST

Reported by Mark Dodwell | May 23rd, 2008 @ 07:30 PM

When you post a login controller action that successfully logins sends a redirect webrat does not to follow the redirected URL.

For example, with a controller with the following:

  def login
    if user = User.authenticate(params['username'], params['password'])
        session[:user_id] = user.id
        redirect_to 'admin/dashboard'
      else
        flash[:notice] = "Login unsuccessful."
      end   
  end

doing:

post '/admin/login', { 'username' => 'joe', 'password' => '1234' }

is not the same as doing this:

post '/admin/login', { 'username' => 'joe', 'password' => '1234' }
get 'admin/dashboard'

I believe this is a bug.

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Ruby Acceptance Testing for Web applications

Shared Ticket Bins

People watching this ticket