-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1773 from DFE-Digital/cookie-redirections
Redirect non GET referers to root_path
- Loading branch information
Showing
2 changed files
with
43 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require 'rails_helper' | ||
|
||
feature "Save the referer" do | ||
scenario "a user accepts the cookies from invalid path" do | ||
visit new_candidates_feedback_path | ||
|
||
click_on "Submit feedback" | ||
click_on "Accept cookies" | ||
|
||
expect(page.current_path).to eq(root_path) | ||
end | ||
|
||
scenario "a user accepts the cookies from valid path" do | ||
visit candidates_signin_path | ||
|
||
click_on "Accept cookies" | ||
|
||
expect(page.current_path).to eq(candidates_signin_path) | ||
end | ||
|
||
scenario "a user accepts the cookies from a blacklisted path" do | ||
visit edit_cookie_preference_path | ||
|
||
click_on "Accept cookies" | ||
|
||
expect(page.current_path).to eq(edit_cookie_preference_path) | ||
end | ||
end |