fix remaining cukes and some cleanup
This commit is contained in:
parent
200887ca45
commit
452de1b866
7 changed files with 27 additions and 19 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
app.publisher = new app.views.Publisher({
|
app.publisher = new app.views.Publisher({
|
||||||
bookmarklet: true
|
standalone: true
|
||||||
});
|
});
|
||||||
|
|
||||||
var contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}";
|
var contents = "#{escape_javascript params[:title]} - #{escape_javascript params[:url]}";
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
= javascript_include_tag 'jquery.textchange.js', "publisher.js"
|
|
||||||
|
|
||||||
:javascript
|
= javascript_include_tag :home
|
||||||
$(function() {
|
|
||||||
$("#publisher").bind('ajax:success', function(){ location.reload(); });
|
|
||||||
});
|
|
||||||
|
|
||||||
#new_status_message_pane
|
#new_status_message_pane
|
||||||
.span-15.last
|
.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}
|
= 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(); });
|
||||||
|
});
|
||||||
|
|
@ -24,8 +24,7 @@ Feature: mentioning a contact from their profile page
|
||||||
Scenario: mentioning while posting to all aspects
|
Scenario: mentioning while posting to all aspects
|
||||||
Given I am on "alice@alice.alice"'s page
|
Given I am on "alice@alice.alice"'s page
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
And I click "Mention" button
|
And I want to mention her from the profile
|
||||||
And I expand the publisher in the modal window
|
|
||||||
And I append "I am eating a yogurt" to the publisher
|
And I append "I am eating a yogurt" to the publisher
|
||||||
And I press "Share" in the modal window
|
And I press "Share" in the modal window
|
||||||
And I wait for the ajax to finish
|
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
|
Scenario: mentioning while posting to just one aspect
|
||||||
Given I am on "alice@alice.alice"'s page
|
Given I am on "alice@alice.alice"'s page
|
||||||
And I have turned off jQuery effects
|
And I have turned off jQuery effects
|
||||||
And I click "Mention" button
|
And I want to mention her from the profile
|
||||||
And I wait for the ajax to finish
|
|
||||||
And I expand the publisher in the modal window
|
|
||||||
And I append "I am eating a yogurt" to the publisher
|
And I append "I am eating a yogurt" to the publisher
|
||||||
And I press the aspect dropdown in the modal window
|
And I press the aspect dropdown in the modal window
|
||||||
And I toggle the aspect "NotPostingThingsHere" in the modal window
|
And I toggle the aspect "NotPostingThingsHere" in the modal window
|
||||||
|
|
|
||||||
|
|
@ -46,10 +46,18 @@ end
|
||||||
|
|
||||||
When /^I append "([^"]*)" to the publisher$/ do |stuff|
|
When /^I append "([^"]*)" to the publisher$/ do |stuff|
|
||||||
elem = find('#status_message_fake_text')
|
elem = find('#status_message_fake_text')
|
||||||
elem.native.send_keys ' ' + stuff
|
elem.native.send_keys(' ' + stuff)
|
||||||
|
|
||||||
wait_until do
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ module PublishingCukeHelpers
|
||||||
def click_publisher
|
def click_publisher
|
||||||
page.execute_script('
|
page.execute_script('
|
||||||
$("#publisher").removeClass("closed");
|
$("#publisher").removeClass("closed");
|
||||||
$("#publisher").find("textarea").focus();
|
$("#publisher").find("#status_message_fake_text").focus();
|
||||||
')
|
')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright (c) 2010-2012, Diaspora Inc. This file is
|
/* Copyright (c) 2010-2012, Diaspora Inc. This file is
|
||||||
* licensed under the Affero General Public License version 3 or later. See
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
* the COPYRIGHT file.
|
* the COPYRIGHT file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
describe("app.views.Publisher", function() {
|
describe("app.views.Publisher", function() {
|
||||||
context("plain publisher", function() {
|
context("plain publisher", function() {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ describe("bookmarklet", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it('verifies we are using the bookmarklet', function(){
|
it('verifies we are using the bookmarklet', function(){
|
||||||
expect(app.publisher.options.bookmarklet).toBeTruthy();
|
expect(app.publisher.options.standalone).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue