Sha256: a88a8869f40d60a75e1d84a5af516ebf424167d811676e64d5470b76cc2e79b3

Contents?: true

Size: 1.49 KB

Versions: 4

Compression:

Stored size: 1.49 KB

Contents

require_relative './spec_helper'

describe "Video List" do
  describe "authenticated" do
    describe "labels" do
      before do
        api = _api(login: user1["login"],
                   application_token: user1["rw_token"])

        @res = api.video_list(user1["login"], authenticated: true, params: { labels: "api,api2" })
      end

      specify { expect(@res.count).to eq(1) }
    end
  end

  describe "Unauthenticated" do
    context "when Public API Feeds is enabled" do
      describe "params" do
        before(:all) do
          @api = unauthenticated_api
        end

        describe "status" do
          context "when multiple values are passed" do
            before do
              @res = @api.video_list(user_with_public_api["login"], params: { status: "replaced,deleted" })
            end
            it_behaves_like "200 OK"
          end

          context "valid param" do
            before do
              @res = @api.video_list(user_with_public_api["login"], params: { status: "processing" })
            end
            it_behaves_like "200 OK"
          end

          context "when invalid param" do
            before do
              @res = @api.video_list(user_with_public_api["login"], params: { status: "boom" })
            end
            it_behaves_like "422 Failure"
          end
        end
      end
    end

    context "when Public API Feeds is disabled" do
      it_behaves_like "Unauthenticated", ->(api) do
        api.video_list(user1["login"])
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vzaar-1.6.2 examples/video_list_spec.rb
vzaar-1.6.1 examples/video_list_spec.rb
vzaar-1.6.0 examples/video_list_spec.rb
vzaar-1.5.3 examples/video_list_spec.rb