mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
Fixed url generated by pull request/compare button
The `:` character was getting escaped leading to an ugly url. This is different from the urls generated when editing the branches in a pull request. In that case the url did not have `:` escaped.
This commit is contained in:
@@ -34,4 +34,18 @@ class HelpersSpec extends Specification {
|
||||
helpers.repositoryDefaultCompareOrigin(repo) mustEqual "parent-user:some-branch"
|
||||
}
|
||||
}
|
||||
|
||||
"encodeCompareBranch" should {
|
||||
"not uri encode /" in {
|
||||
helpers.encodeCompareBranch("foo/bar#baz") mustEqual "foo/bar%23baz"
|
||||
}
|
||||
|
||||
"not uri encode :" in {
|
||||
helpers.encodeCompareBranch("foo:bar#baz") mustEqual "foo:bar%23baz"
|
||||
}
|
||||
|
||||
"uri encode special characters" in {
|
||||
helpers.encodeCompareBranch("!#$&'()+,;=?@[]") mustEqual "%21%23%24%26%27%28%29%2B%2C%3B%3D%3F%40%5B%5D"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user