Empty Flash with Cucumber on Rails 2.3.6, 2,3,7, and 2.3.8 with Authlogic.
This code, using Authlogic (2.1.4, 2.1.3, 2.1.1) fails a Cuke story, using Rails 2.3.5, Webrat (multiple versions) and Cucumber (multiple versions). Capybara fails too.
def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
redirect_back_or_default(dashboard_url, :notice => "Login successful!")
else
render :action => :new
end
end
(This also fails with the old style flash[:notice] version)
The step that fails is
Scenario: Successful Home page login
Given I have signed up as a user
And I am on the home page
And I fill in "Login" with "user"
And I fill in "Password" with "password"
And I press "Log In"
Then I should see "Logged in successfully!"
Flash notice does NOT appear in the HTML dump in cuke. Flash notices appear fine in dev mode or through the browser.
Removing the call to
@user_session.save
makes the notice show up in the output.
Another developer on a completely unrelated project has the same issue. No idea of the cause yet though. New apps without Authlogic work appropriately so that's the only reason we're thinking there's a problem here.
Your thoughts are appreciated.
same happens here.
I see this happening in our application as well.
It seems to be an issue when Authlogic touches the sessions hash. This only happens when redirects happen and the flash is embedded in the session. Confirmed that this is not a Webrat issue. Confirmed that this is not a Rails Integration test issue.
This is strange. Especially when everything was working fine before the new rails release. More importantly, authlogic isn't doing anything crazy with the session, its just storing a persistence token in it. Gotta love the rails "minor" releases.
Keep in mind it's only happening with integration-based tests. This works fine in dev, prod, and even with rspec.
I've confirmed that this is not a rack-test issue
I've succesfully applied to patch by Jesse Storimer at the end of https://rails.lighthouseapp.com/projects/8994/tickets/4743-session-cookie-breaks-if-used-with-custom-cookie-in-rails-238 to fix this.
The fix suggested on that ticket works for me, too.
Hello, I'm going through old authlogic issues and seeing what to do with them. This one looks like a bug report.
If you can still reproduce this issue with a clean install of the latest version of authlogic and rails (currently 3.6.0 and 5.1.4 respectively), please create a git repo with a sample app that reproduces the problem, and open a new issue.
If this was more of a usage question than a bug report, please ask your question on stackoverflow. We don't have enough volunteers to handle usage questions on github.
Thanks!