diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 3d05fb8af..675f4d4fd 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -261,7 +261,7 @@ app.views.Publisher = Backbone.View.extend({ keyDown : function(evt) { if( evt.keyCode == 13 && evt.ctrlKey ) { - this.el_submit.click(); + this.$("form").submit(); this.open(); return false; } diff --git a/spec/controllers/jasmine_fixtures/status_messages_spec.rb b/spec/controllers/jasmine_fixtures/status_messages_spec.rb new file mode 100644 index 000000000..90a2f9df6 --- /dev/null +++ b/spec/controllers/jasmine_fixtures/status_messages_spec.rb @@ -0,0 +1,19 @@ +# Copyright (c) 2010-2011, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3 or later. See +# the COPYRIGHT file. + +require 'spec_helper' + +describe StatusMessagesController do + describe '#bookmarklet' do + before do + sign_in :user, bob + end + + it "generates a jasmine fixture", :fixture => true do + get :bookmarklet + save_fixture(html_for("body"), "bookmarklet") + end + + end +end diff --git a/spec/javascripts/app/views/aspects_dropdown_view_spec.js b/spec/javascripts/app/views/aspects_dropdown_view_spec.js index aa79c32da..6c017ccd5 100644 --- a/spec/javascripts/app/views/aspects_dropdown_view_spec.js +++ b/spec/javascripts/app/views/aspects_dropdown_view_spec.js @@ -1,42 +1,7 @@ describe("app.views.AspectsDropdown", function(){ beforeEach(function() { - spec.content().html( - '
'+ - ' '+ - ' '+ - '
' - ); - - this.view = new app.views.AspectsDropdown({el: spec.content()}); + spec.loadFixture("bookmarklet"); + this.view = new app.views.AspectsDropdown({el: $('.aspect_dropdown')}); }); context('_toggleCheckbox', function() { @@ -96,7 +61,7 @@ describe("app.views.AspectsDropdown", function(){ }); it('select aspects in the dropdown by a given list of ids', function() { - this.ids = [12,'public']; + this.ids = [this.view.$('li.aspect_selector:eq(1)').data('aspect_id'),'public']; this.view._selectAspects(this.ids); expect(this.view.$('li.all_aspects.radio').hasClass('selected')).toBeFalsy(); expect(this.view.$('li.public.radio').hasClass('selected')).toBeTruthy(); @@ -124,7 +89,7 @@ describe("app.views.AspectsDropdown", function(){ it('shows the name of the selected aspect ( == 1 )', function() { this.view.$('li.aspect_selector:eq(1)').addClass('selected'); this.view._updateButton('inAspectClass'); - expect(this.view.$('.btn.dropdown-toggle > .text').text()).toContain("Aspect 12"); + expect(this.view.$('.btn.dropdown-toggle > .text').text()).toContain(this.view.$('li.aspect_selector:eq(1) .text').text()); }); it('shows the number of selected aspects ( > 1)', function() {