Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle CSRF token verification in Rails >= 3.0.4. Fixes #4.
- Loading branch information
David Yip
committed
Jan 4, 2012
1 parent
83cbeb6
commit 466f4c8
Showing
7 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Feature: Rails CSRF interaction | ||
Background: | ||
Given I am using the user interface | ||
And I am logged in as mr296 | ||
|
||
Scenario: CSRF attacks are not processed | ||
When I access a protected page without a CSRF token | ||
Then I am on the login page | ||
|
||
Scenario: Requests with a CSRF token are processed | ||
When I access a protected page with a correct CSRF token | ||
Then I can access that protected page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test-applications/serenity-30/app/views/protected/authentication_only.text.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
CSRF <%= form_authenticity_token %> | ||
I'm protected, <%= current_user.full_name %>. |