|
22 | 22 | and_the_return_url_has_a_token_param_added_to_it |
23 | 23 | end |
24 | 24 |
|
25 | | - scenario "someone has supplied their own external redirect url" do |
| 25 | + scenario "someone has supplied their own absolute redirect url" do |
26 | 26 | given_a_test_team_is_setup_in_mavis_and_cis2 |
27 | 27 | when_i_go_to_the_start_page_with_a_redirect_uri_param_that_does_not_match_the_reporting_app |
28 | 28 |
|
29 | 29 | when_i_click_the_cis2_login_button |
30 | 30 | then_i_see_the_dashboard |
31 | 31 | end |
32 | 32 |
|
| 33 | + scenario "someone has supplied their own schema-relative redirect url" do |
| 34 | + given_a_test_team_is_setup_in_mavis_and_cis2 |
| 35 | + when_i_go_to_the_start_page_with_a_redirect_uri_param_that_is_schema_relative |
| 36 | + |
| 37 | + when_i_click_the_cis2_login_button |
| 38 | + then_i_see_the_dashboard |
| 39 | + end |
| 40 | + |
33 | 41 | def given_a_test_team_is_setup_in_mavis_and_cis2 |
34 | 42 | @user = create(:user, uid: "123") |
35 | 43 | @team = create(:team, users: [@user]) |
@@ -61,12 +69,14 @@ def when_i_go_to_the_start_page_with_a_redirect_uri_param_that_matches_the_repor |
61 | 69 | visit [start_path, "redirect_uri=#{uri}"].join("?") |
62 | 70 | end |
63 | 71 |
|
64 | | - def redirect_elsewhere_url |
65 | | - "https://some.example.com/redirect/elsewhere" |
| 72 | + def when_i_go_to_the_start_page_with_a_redirect_uri_param_that_is_schema_relative |
| 73 | + uri = |
| 74 | + URI.encode_uri_component("https://some.example.com/redirect/elsewhere") |
| 75 | + visit [start_path, "redirect_uri=#{uri}"].join("?") |
66 | 76 | end |
67 | 77 |
|
68 | 78 | def when_i_go_to_the_start_page_with_a_redirect_uri_param_that_does_not_match_the_reporting_app |
69 | | - uri = URI.encode_uri_component(redirect_elsewhere_url) |
| 79 | + uri = URI.encode_uri_component("//some.example.com/redirect/elsewhere") |
70 | 80 | visit [start_path, "redirect_uri=#{uri}"].join("?") |
71 | 81 | end |
72 | 82 |
|
|
0 commit comments