diff --git a/app/views/status_messages/bookmarklet.html.haml b/app/views/status_messages/bookmarklet.html.haml index 1c5aa4010..992da8686 100644 --- a/app/views/status_messages/bookmarklet.html.haml +++ b/app/views/status_messages/bookmarklet.html.haml @@ -10,7 +10,7 @@ :javascript app.publisher = new app.views.Publisher({ - bookmarklet: true + standalone: true }); var contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}"; diff --git a/app/views/status_messages/new.html.haml b/app/views/status_messages/new.html.haml index d2d38ad81..fb87afa89 100644 --- a/app/views/status_messages/new.html.haml +++ b/app/views/status_messages/new.html.haml @@ -1,12 +1,8 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. -= javascript_include_tag 'jquery.textchange.js', "publisher.js" -:javascript - $(function() { - $("#publisher").bind('ajax:success', function(){ location.reload(); }); - }); += javascript_include_tag :home #new_status_message_pane .span-15.last @@ -16,3 +12,10 @@ = render :partial => 'shared/publisher', :locals => { :aspect => @aspect, :aspect_ids => @aspect_ids, :selected_aspects => @aspects_with_person, :person => @person} +:javascript + $(function() { + app.publisher = new app.views.Publisher({ + standalone: true + }); + $("#publisher").bind('ajax:success', function(){ location.reload(); }); + }); \ No newline at end of file diff --git a/features/mentions_from_profile_page.feature b/features/mentions_from_profile_page.feature index a3b86c3d7..be8e5d113 100644 --- a/features/mentions_from_profile_page.feature +++ b/features/mentions_from_profile_page.feature @@ -24,8 +24,7 @@ Feature: mentioning a contact from their profile page Scenario: mentioning while posting to all aspects Given I am on "alice@alice.alice"'s page And I have turned off jQuery effects - And I click "Mention" button - And I expand the publisher in the modal window + And I want to mention her from the profile And I append "I am eating a yogurt" to the publisher And I press "Share" in the modal window And I wait for the ajax to finish @@ -42,9 +41,7 @@ Feature: mentioning a contact from their profile page Scenario: mentioning while posting to just one aspect Given I am on "alice@alice.alice"'s page And I have turned off jQuery effects - And I click "Mention" button - And I wait for the ajax to finish - And I expand the publisher in the modal window + And I want to mention her from the profile And I append "I am eating a yogurt" to the publisher And I press the aspect dropdown in the modal window And I toggle the aspect "NotPostingThingsHere" in the modal window diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb index 67b95e7eb..6942655d0 100644 --- a/features/step_definitions/custom_web_steps.rb +++ b/features/step_definitions/custom_web_steps.rb @@ -46,10 +46,18 @@ end When /^I append "([^"]*)" to the publisher$/ do |stuff| elem = find('#status_message_fake_text') - elem.native.send_keys ' ' + stuff + elem.native.send_keys(' ' + stuff) wait_until do - page.find("#status_message_text").value.match(/#{stuff}/) + find('#status_message_text').value.include?(stuff) + end +end + +And /^I want to mention (?:him|her) from the profile$/ do + click_link("Mention") + wait_for_ajax_to_finish + within('#facebox') do + click_publisher end end diff --git a/features/support/publishing_cuke_helpers.rb b/features/support/publishing_cuke_helpers.rb index 6bfa7a290..de447cc7a 100644 --- a/features/support/publishing_cuke_helpers.rb +++ b/features/support/publishing_cuke_helpers.rb @@ -13,7 +13,7 @@ module PublishingCukeHelpers def click_publisher page.execute_script(' $("#publisher").removeClass("closed"); - $("#publisher").find("textarea").focus(); + $("#publisher").find("#status_message_fake_text").focus(); ') end @@ -79,7 +79,7 @@ module PublishingCukeHelpers end def comment_on_show_page(comment_text) - within("#post-interactions") do + within("#post-interactions") do focus_comment_box(".label.comment") make_comment(comment_text, "new-comment-text") end diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index d5be5c852..b1c55e64a 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -1,7 +1,7 @@ /* Copyright (c) 2010-2012, Diaspora Inc. This file is -* licensed under the Affero General Public License version 3 or later. See -* the COPYRIGHT file. -*/ + * licensed under the Affero General Public License version 3 or later. See + * the COPYRIGHT file. + */ describe("app.views.Publisher", function() { context("plain publisher", function() { diff --git a/spec/javascripts/bookmarklet-spec.js b/spec/javascripts/bookmarklet-spec.js index 9a73cb51c..57ac4925a 100644 --- a/spec/javascripts/bookmarklet-spec.js +++ b/spec/javascripts/bookmarklet-spec.js @@ -15,7 +15,7 @@ describe("bookmarklet", function() { }); it('verifies we are using the bookmarklet', function(){ - expect(app.publisher.options.bookmarklet).toBeTruthy(); + expect(app.publisher.options.standalone).toBeTruthy(); }); });