diff --git a/Gemfile b/Gemfile index bc5c790e5..707b86532 100644 --- a/Gemfile +++ b/Gemfile @@ -86,7 +86,7 @@ gem "entypo-rails", "3.0.0.pre.rc2" # JavaScript -gem "backbone-on-rails", "1.1.2.1" +gem "backbone-on-rails", "1.2.0.0" gem "handlebars_assets", "0.20.2" gem "jquery-rails", "4.0.4" gem "jquery-ui-rails", "5.0.5" diff --git a/Gemfile.lock b/Gemfile.lock index c8da2359f..99da945ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -60,7 +60,7 @@ GEM autoprefixer-rails (5.2.1) execjs json - backbone-on-rails (1.1.2.1) + backbone-on-rails (1.2.0.0) eco ejs jquery-rails @@ -774,7 +774,7 @@ DEPENDENCIES addressable (= 2.3.8) asset_sync (= 1.1.0) autoprefixer-rails (= 5.2.1) - backbone-on-rails (= 1.1.2.1) + backbone-on-rails (= 1.2.0.0) bootstrap-sass (= 3.3.5) bootstrap-switch-rails (= 3.3.3) capybara (= 2.4.4) diff --git a/app/assets/javascripts/app/router.js b/app/assets/javascripts/app/router.js index 6ec0618fd..8bce2b284 100644 --- a/app/assets/javascripts/app/router.js +++ b/app/assets/javascripts/app/router.js @@ -132,7 +132,7 @@ app.Router = Backbone.Router.extend({ {tagText: decodeURIComponent(name).toLowerCase()} ); $("#author_info").prepend(followedTagsAction.render().el); - app.tags = new app.views.Tags({tagName: name}); + app.tags = new app.views.Tags({hashtagName: name}); } this._hideInactiveStreamLists(); }, diff --git a/app/assets/javascripts/app/views/tags_view.js b/app/assets/javascripts/app/views/tags_view.js index cf13dbb49..e420281fb 100644 --- a/app/assets/javascripts/app/views/tags_view.js +++ b/app/assets/javascripts/app/views/tags_view.js @@ -1,9 +1,8 @@ // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-v3-or-Later app.views.Tags = Backbone.View.extend({ - - initialize: function() { - app.publisher.setText("#"+ this.tagName + " "); + initialize: function(opts) { + app.publisher.setText("#"+ opts.hashtagName + " "); } }); // @license-end diff --git a/spec/javascripts/app/views/feedback_view_spec.js b/spec/javascripts/app/views/feedback_view_spec.js index cc6b5da35..18f093fe6 100644 --- a/spec/javascripts/app/views/feedback_view_spec.js +++ b/spec/javascripts/app/views/feedback_view_spec.js @@ -60,13 +60,19 @@ describe("app.views.Feedback", function(){ }); it("allows for unliking a just-liked post", function(){ - var responseText = JSON.stringify({"author": this.userAttrs}); - var ajax_success = { status: 201, responseText: responseText }; expect(this.link().text()).toContain(Diaspora.I18n.t("stream.like")); this.link().click(); - jasmine.Ajax.requests.mostRecent().respondWith(ajax_success); + jasmine.Ajax.requests.mostRecent().respondWith({ + status: 201, + responseText: JSON.stringify({ + id: 42, + guid: 42, + author: this.userAttrs + }) + }); expect(this.link().text()).toContain(Diaspora.I18n.t("stream.unlike")); this.link().click(); + jasmine.Ajax.requests.mostRecent().respondWith({status: 204}); expect(this.link().text()).toContain(Diaspora.I18n.t("stream.like")); }); });