Skip to content

Commit

Permalink
Query string test is 1.8 friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
paneq committed Aug 30, 2013
1 parent c8105c6 commit f922cd9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/embedda_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
require "spec_helper"
require "rack"
require "uri"

require "embedda"

describe Embedda do
Expand Down Expand Up @@ -116,8 +119,10 @@

it 'generates iframe with query string' do
@story = "http://vimeo.com/20241459"
embedda = described_class.new(@story, :vimeo_params => {:title => 0, :byline => 0, :portrait => 0, :color => "42b7ed"}).embed
expect(embedda).to eq(query_string_embed)
vimeo_params = {:title => 0, :byline => 0, :portrait => 0, :color => "42b7ed"}
embedda = described_class.new(@story, :vimeo_params => vimeo_params).embed
vimeo_expected_params = {"title" => "0", "byline" => "0", "portrait" => "0", "color" => "42b7ed"}
Rack::Utils.parse_query( URI.parse(embedda.split('"')[1]).query ).should == vimeo_expected_params
end

it 'generates iframe without height attribute when height is falsy' do
Expand Down

0 comments on commit f922cd9

Please sign in to comment.