Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3875516
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:16:34+00:00 2026-05-19T22:16:34+00:00

We’ve got a Rails application just upgraded to Rails3 using Devise’s Rails3 gem for

  • 0

We’ve got a Rails application just upgraded to Rails3 using Devise’s Rails3 gem for authentication. We’ve been using Capybara with Celerity backend to test some of the pages.

When accessing the application in a browser, Devise responds with a redirect to the login page when a user is trying to access a protected page/controller.

In the Rails 2.x version of Devise this used to work even if the incoming request had a blank accept header */*.

In the Rails 3 version, Devise responds with a plain text string when the accept header is blank.

The reason the blank accept header thing matters is because we’re using the Celerity backend of Capybara to test some of the pages, and apparently Celerity sends a blank accept header, and thus doesn’t get redirected by Devise. This behavior has changed from Devise for Rails 2.x to Devise for Rails 3.

Celerity fails with an UnexpectedPageException and the server log reports that the request was made with */* as accept header.

When using the Selenium/Webdriver backend on the exact same test suite, the problem goes away.

There are two ways to tackle this:

  1. Tell Devise to somehow always assume text/html as accept header and respond accordingly. How could that be done? Do we have to override the controllers?
  2. “Fix” Celerity to sent text/html as accept header. How can this be done?
  3. Is this an HTMLUnit problem/bug?

To me #2 looks like the “right” way to fix this, but I’m not sure if Celerity/HTMLUnit’s lack of accept header is a bug or a feature. Thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:16:34+00:00Added an answer on May 19, 2026 at 10:16 pm

    It turns out to be an issue with HTMLUnit. I’ve made a patch to the Celerity gem which you can find here: https://github.com/jarib/celerity/pull/49

    It will set the default accept header to “text/html” but also adds an optional parameter to override it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
i got an object with contents of html markup in it, for example: string
I've got a string that has curly quotes in it. I'd like to replace
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I want to count how many characters a certain string has in PHP, but
I have a JSP page retrieving data and when single or double quotes are
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.