Skip to content

Commit

Permalink
Merge branch 'next-minor' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
svbergerem committed Oct 23, 2016
2 parents 0b4215e + ac08e93 commit 9a09515
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Expand Up @@ -41,6 +41,7 @@ Note: Although this is a minor release, the configuration file changed because t
* Fix duplicate flash message on mobile profile edit [#7107](https://github.com/diaspora/diaspora/pull/7107)
* Clicking photos on mobile should no longer cause 404s [#7071](https://github.com/diaspora/diaspora/pull/7071)
* Fix avatar size on mobile privacy page for ignored people [#7148](https://github.com/diaspora/diaspora/pull/7148)
* Don't display tag following button when logged out [#7155](https://github.com/diaspora/diaspora/pull/7155)

## Features
* Deleted comments will be removed when loading more comments [#7045](https://github.com/diaspora/diaspora/pull/7045)
Expand Down
8 changes: 5 additions & 3 deletions app/assets/javascripts/app/router.js
Expand Up @@ -113,10 +113,12 @@ app.Router = Backbone.Router.extend({
app.tagFollowings.reset(gon.preloads.tagFollowings);

if (name) {
var followedTagsAction = new app.views.TagFollowingAction(
if (app.currentUser.authenticated()) {
var followedTagsAction = new app.views.TagFollowingAction(
{tagText: decodeURIComponent(name).toLowerCase()}
);
$("#author_info").prepend(followedTagsAction.render().el);
);
$("#author_info").prepend(followedTagsAction.render().el);
}
app.tags = new app.views.Tags({hashtagName: name});
}
this._hideInactiveStreamLists();
Expand Down
10 changes: 10 additions & 0 deletions spec/javascripts/app/router_spec.js
Expand Up @@ -26,6 +26,16 @@ describe('app.Router', function () {
expect(followed_tags).toHaveBeenCalled();
expect(tag_following_action).toHaveBeenCalledWith({tagText: 'somethingwithcapitalletters'});
});

it("does not add the TagFollowingAction if not logged in", function() {
var followedTags = spyOn(app.router, "followed_tags").and.callThrough();
var tagFollowingAction = spyOn(app.views, "TagFollowingAction");
logout();

app.router.followed_tags("some_tag");
expect(followedTags).toHaveBeenCalled();
expect(tagFollowingAction).not.toHaveBeenCalled();
});
});

describe("when routing to /stream and hiding inactive stream lists", function() {
Expand Down

0 comments on commit 9a09515

Please sign in to comment.