Skip to content
Extraits de code Groupes Projets
Valider 452de1b8 rédigé par Florian Staudacher's avatar Florian Staudacher
Parcourir les fichiers

fix remaining cukes and some cleanup

parent 200887ca
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -10,7 +10,7 @@ ...@@ -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]}";
......
-# 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 @@ ...@@ -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(); });
});
\ No newline at end of file
...@@ -24,8 +24,7 @@ Feature: mentioning a contact from their profile page ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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
...@@ -79,7 +79,7 @@ module PublishingCukeHelpers ...@@ -79,7 +79,7 @@ module PublishingCukeHelpers
end end
def comment_on_show_page(comment_text) def comment_on_show_page(comment_text)
within("#post-interactions") do within("#post-interactions") do
focus_comment_box(".label.comment") focus_comment_box(".label.comment")
make_comment(comment_text, "new-comment-text") make_comment(comment_text, "new-comment-text")
end end
......
/* 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() { ...@@ -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();
}); });
}); });
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter