Sha256: 7b717582c5fdfe1d371260621919979925e33bf5ae4af69bcad24e5c4683b8bd

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

require_relative './spec_helper'

describe "Video Details" do
  describe "Authenticated" do
    before do
      api = _api(login: user1["login"],
                 application_token: user1["rw_token"])

      @res = api.video_details(test_video_id("user1"), authenticated: true)
    end

    it_behaves_like "200 OK"
  end

  describe "Unauthenticated" do
    context "Fully Protected API" do
      it_behaves_like "Unauthenticated", ->(api) do
        api.video_details(test_video_id("user1"))
      end
    end

    context "Public API" do
      before(:all) do
        api = unauthenticated_api
        @res = api.video_details(test_video_id("user_with_public_api"))
      end

      it_behaves_like "200 OK"
    end

    context "Protected API with access for public videos" do
      scope = api_envs[env]["user_with_public_videos_access_only"]

      context "when video is public" do
        before do
          api = unauthenticated_api
          @res = api.video_details(scope["test_public_video_id"])
        end

        it_behaves_like "200 OK"
      end

      context "when video is private" do
        it_behaves_like "Unauthenticated", ->(api) do
          api.video_details(scope["test_video_id"])
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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