Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

NoRedirectionStickinessHtml tests escaped url path #316

Open
cilim opened this issue Sep 6, 2016 · 4 comments
Open

NoRedirectionStickinessHtml tests escaped url path #316

cilim opened this issue Sep 6, 2016 · 4 comments

Comments

@cilim
Copy link

cilim commented Sep 6, 2016

Hello everyone,
I'm the Rails contractor that's working on the stormpath-rails integration.

The testNoRedirectionStickinessHtml test in LoginIT.groovy asserts escaped url path, which causes tests to fail in Rails.

public void testNoRedirectionStickinessHtml() throws Exception {
     ...
        req
            .when()
                .get(FrameworkConstants.MeRoute)
            .then()
                .statusCode(302)
                .header("Location", urlMatchesPath("/login?next=%2Fme")) //we must be redirected to login

        ...
    }

Changing the %2F to an unescaped / solves the issue.

req
  .when()
     .get(FrameworkConstants.MeRoute)
  .then()
     .statusCode(302)
     .header("Location", urlMatchesPath("/login?next=/me"))

Do other frameworks need this character escaped and should we escape it in Rails, or are you going to unescape it?

@nbarbettini
Copy link
Member

This test was specifically added to test a regression in the JSDK, so I could see an argument for removing it from the TCK entirely (it may be better suited for a JSDK IT). Thoughts @omgitstom or @edjiang?

@edjiang
Copy link
Contributor

edjiang commented Sep 6, 2016

It should be like this, only asserting the path. Not sure when it got changed, though, or why.

#288

@cilim
Copy link
Author

cilim commented Sep 7, 2016

Found the commit: 80a0ae4

@dogeared can you change the %2F to an unescaped / or does it need to stay like this?

@edjiang
Copy link
Contributor

edjiang commented Sep 7, 2016

We shouldn't be checking for the next parameter, as that's not in the framework spec.

See https://github.com/stormpath/stormpath-framework-spec/pull/94/files

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

No branches or pull requests

3 participants