Sha256: 8873ec5334b3e685060578c66f981bc0f1517e27e5fdcc9808b860c62b59e631

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 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.5.2 examples/video_details_spec.rb
vzaar-1.5.1 examples/video_details_spec.rb
vzaar-1.5.0 examples/video_details_spec.rb
vzaar-1.4.4 examples/video_details_spec.rb