fix remaining cukes and some cleanup

This commit is contained in:
Florian Staudacher 2012-09-17 20:35:38 +02:00
parent 200887ca45
commit 452de1b866
7 changed files with 27 additions and 19 deletions

View file

@ -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]}";

View file

@ -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(); });
});

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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() {

View file

@ -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();
});
});