Sha256: 89550e0789d31e6e56b13dae29a6f382e31fea3f637a0acb8975afef8fc48993
Contents?: true
Size: 1.83 KB
Versions: 3
Compression:
Stored size: 1.83 KB
Contents
require_relative './spec_helper' describe "Upload Video" do context "File uploads" do file_path = "./spec/support/video.mov" desc = "Upload Video/File Uploads" context "Authenticated User" do context "RW token" do before(:all) do 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, profile: "boom") # cleanup api.delete_video(@res.id) end specify { expect(@res.http_status_code).to eq 201 } specify { expect(@res.id.to_s).to match(/^[0-9]+$/) } end context "RO token" do it_behaves_like "RO only", user1["login"], user1["ro_token"], ->(api) do api.upload_video(path: file_path, description: desc) end end end context "when user is unauthenticated" do it_behaves_like "Unauthenticated", ->(api) do api.upload_video(path: file_path, title: "woof", description: desc) end end end context "Link uploads" do desc = "Upload Video/Link Uploads" file_url = "http://samples.mplayerhq.hu/MPEG-4/turn-on-off.mp4" context "Authenticated User" do before(:all) do api = _api(login: user1["login"], application_token: user1["rw_token"]) title = "api-test-#{rand_str}" @res = api.upload_video(url: file_url, title: title, description: desc) # cleanup api.delete_video(@res.id) end specify { expect(@res.http_status_code).to eq 200 } specify { expect(@res.id.to_s).to match(/^[0-9]+$/) } end context "when user is unauthenticated" do it_behaves_like "Unauthenticated", ->(api) do api.upload_video(url: file_url, title: "woof", description: desc) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
vzaar-1.6.2 | examples/upload_video_spec.rb |
vzaar-1.6.1 | examples/upload_video_spec.rb |
vzaar-1.6.0 | examples/upload_video_spec.rb |