Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when TGT not found in database? #4

Open
ghost opened this issue May 17, 2009 · 1 comment
Open

error when TGT not found in database? #4

ghost opened this issue May 17, 2009 · 1 comment
Labels

Comments

@ghost
Copy link

ghost commented May 17, 2009

Is this spec supposed to pass?

it "returns a Ticket that is valid when it cannot find a TGT" do
TicketGrantingTicket.stub!(:find_by_ticket).return(nil)
TicketGrantingTicket.validate_cookie(’abc’).should be_valid
end

I would think it shouldn’t be valid, but when you add this spec for TGT, it passes.

original LH ticket

This ticket has 0 attachment(s).

@Gazer
Copy link

Gazer commented May 12, 2010

I found this too and this made that Passenger restart the app every few seconds because sometimes a ticket_result.username can't be delegate beacuse the ticket is nil, but the ticket result is valid.

A quick fix I made was add in TicketResult#valid? :
def valid?
ticket && !invalid?
end

And that fix my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant