From 45d621a9e64ba9334ea5a779ab45f4f9bf49bffc Mon Sep 17 00:00:00 2001 From: MrZYX Date: Thu, 21 Apr 2011 15:42:28 +0200 Subject: [PATCH] fixed embedder the hacky way (?) and added cucumber feature for youtube feature so you'll notice if you breakt it again the next time --- features/embedder.feature | 19 +++++++++++++++++++ public/javascripts/diaspora.js | 5 +++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 features/embedder.feature diff --git a/features/embedder.feature b/features/embedder.feature new file mode 100644 index 000000000..9db04a389 --- /dev/null +++ b/features/embedder.feature @@ -0,0 +1,19 @@ +@javascript +Feature: embedding + Get sure that embedding stuff actually works + + Background: + Given a user with username "bob" + When I sign in as "bob@bob.bob" + And I have no open aspects saved + And I am on the home page + + Scenario: Youtube is fully embedded + Given I expand the publisher + When I fill in "status_message_fake_text" with "Look at this awesome video: https://www.youtube.com/watch?v=53tq9g35kwk" + And I press "Share" + And I follow "All Aspects" + Then I should see "Look at this awesome video: Youtube: Leekspin" within ".stream_element" + When I follow "Youtube: Leekspin" + And I wait for the ajax to finish + Then I should see "Watch this video on YouTube" within ".video-container" diff --git a/public/javascripts/diaspora.js b/public/javascripts/diaspora.js index 9b8080dd7..389f461e3 100644 --- a/public/javascripts/diaspora.js +++ b/public/javascripts/diaspora.js @@ -31,7 +31,8 @@ this.initialized = true; for(var widgetId in this.collection) { - if(this.collection[widgetId].hasOwnProperty("start")) { + if(this.collection[widgetId].hasOwnProperty("start") + || this.collection[widgetId].__proto__.hasOwnProperty("start")) { this.collection[widgetId].start(); } } @@ -51,5 +52,5 @@ })(); -$(document).ready(Diaspora.widgets.init); +$(document).ready(function() { Diaspora.widgets.init(); });