Sha256: 25b875db2695da45a0b3adec57b59137bad6712e269b38becd211be59894db93

Contents?: true

Size: 1.17 KB

Versions: 12

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'
require './lib/vzaar/request/process_video'

describe Vzaar::Request::ProcessVideo do
  subject { described_class.new nil, opts }

  describe "#get_opts" do
    context "when options received are missing guid" do
      let(:opts) { {} }

      it "should raise an exception" do
        expect { subject.send(:get_opts) }.to raise_error Vzaar::Error, "Guid required to process video."
      end
    end

    shared_examples "options have the guid" do
      it "should format the hash" do
        expect(subject.send(:get_opts)).to eq(expected_opts)
      end
    end

    context "when options received contain the guid" do
      let(:opts) { { guid: "testguid", title: "sometitle" } }
      let(:expected_opts) { { vzaar_api: { video: opts } } }

      it_behaves_like "options have the guid"
    end

    context "when options have guid and encoding information" do
      let(:opts) { { guid: "testguid", title: "sometitle", profile: 6, width: 10, bitrate: 20 } }
      let(:expected_opts) { { vzaar_api: { video: { guid: "testguid", title: "sometitle", profile: 6, encoding: { width: 10, bitrate: 20 } } } } }

      it_behaves_like "options have the guid"
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
vzaar-1.6.2 spec/vzaar/request/process_video_spec.rb
vzaar-1.6.1 spec/vzaar/request/process_video_spec.rb
vzaar-1.6.0 spec/vzaar/request/process_video_spec.rb
vzaar-1.5.3 spec/vzaar/request/process_video_spec.rb
vzaar-1.5.2 spec/vzaar/request/process_video_spec.rb
vzaar-1.5.1 spec/vzaar/request/process_video_spec.rb
vzaar-1.5.0 spec/vzaar/request/process_video_spec.rb
vzaar-1.4.4 spec/vzaar/request/process_video.rb
vzaar-1.4.1 spec/vzaar/request/process_video.rb
vzaar-1.3.1 spec/vzaar/request/process_video.rb
vzaar-1.3.0 spec/vzaar/request/process_video.rb
vzaar-1.2.4 spec/vzaar/request/process_video.rb