Sha256: 9634541bf0f53dd2782420d5d7c40bc90e1dcfcf0fce1692298de0f26e5ac37c

Contents?: true

Size: 960 Bytes

Versions: 1

Compression:

Stored size: 960 Bytes

Contents

require_relative './spec_helper'

describe "Delete Video" do
  vid_id = nil

  before(:all) do
    file_path = "./spec/support/video.mov"
    desc = "Delete Video"
    @api = _api(login: user1["login"],
               application_token: user1["rw_token"])

    @title = "api-test-#{rand_str}"

    res = @api.upload_video(path: file_path, title: @title, description: desc)
    vid_id = res.id
  end

  context "when user is unauthenticated" do
    it_behaves_like "Unauthenticated", -> (api) do
      api.delete_video(vid_id)
    end
  end

  context "Authenticated User" do
    context "RW token" do
      before(:all) do
        @res = @api.delete_video(vid_id)
      end

      specify { expect(@res.http_status_code).to eq 200 }
      specify { expect(@res.title).to eq(@title) }
    end

    context "RO token" do
      it_behaves_like "RO only", user1["login"], user1["ro_token"], -> (api) do
        api.delete_video(vid_id)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vzaar-1.3.0 examples/delete_video_spec.rb