diff --git a/features/oembed.feature b/features/oembed.feature index 9cfb0691f..1efbce05a 100644 --- a/features/oembed.feature +++ b/features/oembed.feature @@ -17,6 +17,8 @@ Feature: oembed And I follow "My Aspects" Then I should see a video player + And I should see a ".oembed" within ".post-content" + And I should see a "img" within ".oembed" Scenario: Post an unsecure video link Given I expand the publisher diff --git a/features/step_definitions/oembed.rb b/features/step_definitions/oembed.rb index ade28cc3c..155503e48 100644 --- a/features/step_definitions/oembed.rb +++ b/features/step_definitions/oembed.rb @@ -36,6 +36,9 @@ Given /^I have several oEmbed data in cache$/ do type=\"application/x-shockwave-flash\" width=\"425\" height=\"344\" allowscriptaccess=\"always\" allowfullscreen=\"true\"> ", + "thumbnail_url" => "http://i2.ytimg.com/vi/M3r2XDceM6A/hqdefault.jpg", + "thumbnail_height" => 360, + "thumbnail_width" => 480, }, "link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json", "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", @@ -54,6 +57,9 @@ Given /^I have several oEmbed data in cache$/ do type=\"application/x-shockwave-flash\" width=\"425\" height=\"344\" allowscriptaccess=\"always\" allowfullscreen=\"true\"> ", + "thumbnail_url" => "http://i2.ytimg.com/vi/M3r2XDceM6A/hqdefault.jpg", + "thumbnail_height" => 360, + "thumbnail_width" => 480, }, "link_url" => "http://myrichtube.com/watch?v=M3r2XDceM6A&format=json", "discovery_data" => '', @@ -75,6 +81,9 @@ Given /^I have several oEmbed data in cache$/ do type=\"application/x-shockwave-flash\" width=\"425\" height=\"344\" allowscriptaccess=\"always\" allowfullscreen=\"true\"> ", + "thumbnail_url" => "http://i2.ytimg.com/vi/M3r2XDceM6A/hqdefault.jpg", + "thumbnail_height" => 360, + "thumbnail_width" => 480, }, "link_url" => "http://yourichtube.com/watch?v=M3r2XDceM6A&format=json", "oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A", @@ -93,6 +102,9 @@ Given /^I have several oEmbed data in cache$/ do type=\"application/x-shockwave-flash\" width=\"425\" height=\"344\" allowscriptaccess=\"always\" allowfullscreen=\"true\"> ", + "thumbnail_url" => "http://i2.ytimg.com/vi/M3r2XDceM6A/hqdefault.jpg", + "thumbnail_height" => 360, + "thumbnail_width" => 480, }, "link_url" => "http://mytube.com/watch?v=M3r2XDceM6A&format=json", "discovery_data" => '', @@ -103,7 +115,9 @@ Given /^I have several oEmbed data in cache$/ do unless type=='unsupported' url = data['oembed_get_request'].split('?')[0] store_data = data['oembed_data'].merge('trusted_endpoint_url' => url) - OEmbedCache.new(:url => data['link_url'], :data => store_data.to_json); + oembed = OEmbedCache.new(:url => data['link_url']); + oembed.data = store_data + oembed.save! end end end diff --git a/public/images/video-overlay.png b/public/images/video-overlay.png new file mode 100644 index 000000000..dbeee2bb7 Binary files /dev/null and b/public/images/video-overlay.png differ diff --git a/public/javascripts/app/templates/status-message.handlebars b/public/javascripts/app/templates/status-message.handlebars index 584d3a281..a20dfac00 100644 --- a/public/javascripts/app/templates/status-message.handlebars +++ b/public/javascripts/app/templates/status-message.handlebars @@ -16,5 +16,16 @@