Skip to content
Extraits de code Groupes Projets
Valider 60bd29aa rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

decode tag name before passing it into TagFollowingAction, fixes #4027

parent f8513c20
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
* Delegate parent_author to the target of a RelayableRetraction * Delegate parent_author to the target of a RelayableRetraction
* Do not fail on receiving a SignedRetraction via the public route * Do not fail on receiving a SignedRetraction via the public route
* Pass the real values to stderr_path and stdout_path in unicorn.rb since it runs a case statement on them. * Pass the real values to stderr_path and stdout_path in unicorn.rb since it runs a case statement on them.
* Decode tag name before passing it into a TagFollowingAction [#4027](https://github.com/diaspora/diaspora/issues/4027)
## Refactor ## Refactor
......
...@@ -77,7 +77,7 @@ app.Router = Backbone.Router.extend({ ...@@ -77,7 +77,7 @@ app.Router = Backbone.Router.extend({
if(name) { if(name) {
var followedTagsAction = new app.views.TagFollowingAction( var followedTagsAction = new app.views.TagFollowingAction(
{tagText: name} {tagText: decodeURIComponent(name)}
); );
$("#author_info").prepend(followedTagsAction.render().el) $("#author_info").prepend(followedTagsAction.render().el)
} }
......
describe('app.Router', function () {
describe('followed_tags', function() {
it('decodes name before passing it into TagFollowingAction', function () {
var followed_tags = spyOn(app.router, 'followed_tags').andCallThrough();
var tag_following_action = spyOn(app.views, 'TagFollowingAction').andCallFake(function(data) {
return {render: function() { return {el: ""}}};
});
spyOn(window.history, 'pushState').andCallFake(function (data, title, url) {
var route = app.router._routeToRegExp("tags/:name");
var args = app.router._extractParameters(route, url.replace(/^\//, ""));
app.router.followed_tags(args[0]);
});
window.preloads = {tagFollowings: []};
app.router.navigate('/tags/'+encodeURIComponent('օբյեկտիվ'));
expect(followed_tags).toHaveBeenCalled();
expect(tag_following_action).toHaveBeenCalledWith({tagText: 'օբյեկտիվ'});
});
});
});
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter