Sha256: c6c77ac4d086b40e795f0bf0394f0f695c236273b19bb22ec2e8511ad4630474

Contents?: true

Size: 1021 Bytes

Versions: 23

Compression:

Stored size: 1021 Bytes

Contents

require 'spec_helper'

describe LinkThumbnailer::Models::Video do

  let(:src)       { 'http://foo.com/foo.swf' }
  let(:instance)  { described_class.new(src) }

  describe '#to_s' do

    let(:action) { instance.to_s }

    it { expect(action).to eq(src) }

  end

  describe '#as_json' do

    let(:action)      { instance.as_json }
    let(:id)          { 1 }
    let(:size)        { [1, 1] }
    let(:duration)    { 10 }
    let(:provider)    { 'foo' }
    let(:embed_code)  { 'bar' }
    let(:result)      {
      {
        id:         id,
        src:        src,
        size:       size,
        duration:   duration,
        provider:   provider,
        embed_code: embed_code
      }
    }

    before do
      instance.stub(:id).and_return(id)
      instance.stub(:size).and_return(size)
      instance.stub(:duration).and_return(duration)
      instance.stub(:provider).and_return(provider)
      instance.stub(:embed_code).and_return(embed_code)
    end

    it { expect(action).to eq(result) }

  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
link_thumbnailer-3.3.0 spec/models/video_spec.rb
link_thumbnailer-3.2.1 spec/models/video_spec.rb
link_thumbnailer-3.2.0 spec/models/video_spec.rb
link_thumbnailer-3.1.2 spec/models/video_spec.rb
link_thumbnailer-3.1.1 spec/models/video_spec.rb
link_thumbnailer-3.1.0 spec/models/video_spec.rb
link_thumbnailer-3.0.3 spec/models/video_spec.rb
link_thumbnailer-3.0.2 spec/models/video_spec.rb
link_thumbnailer-3.0.1 spec/models/video_spec.rb
link_thumbnailer-3.0.0 spec/models/video_spec.rb
link_thumbnailer-2.6.1 spec/models/video_spec.rb
link_thumbnailer-2.6.0 spec/models/video_spec.rb
link_thumbnailer-2.5.2 spec/models/video_spec.rb
link_thumbnailer-2.5.1 spec/models/video_spec.rb
link_thumbnailer-2.5.0 spec/models/video_spec.rb
link_thumbnailer-2.4.0 spec/models/video_spec.rb
link_thumbnailer-2.3.2 spec/models/video_spec.rb
link_thumbnailer-2.3.1 spec/models/video_spec.rb
link_thumbnailer-2.3.0 spec/models/video_spec.rb
link_thumbnailer-2.2.3 spec/models/video_spec.rb