Skip to content

Commit

Permalink
Merge pull request elcuervo#1 from picandocodigo/master
Browse files Browse the repository at this point in the history
Adds delete media
  • Loading branch information
elcuervo committed Jul 10, 2012
2 parents 5a711fb + ccdc79a commit e7ce830
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/limelight_video.rb
Expand Up @@ -90,6 +90,12 @@ def remove_metadata(names)
end
end

def delete_media(media_id)
# http://api.videoplatform.limelight.com/rest/organizations/<org id>/media/<media id>
path = generate_encoded_path('delete', "#{@base_url}/#{media_id}")
@client.delete(path)
end

private

def generate_encoded_path(method = 'get', path = @base_url)
Expand Down
138 changes: 138 additions & 0 deletions test/fixtures/cassettes/limelight_delete_io.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions test/integration/limelight_test.rb
Expand Up @@ -43,4 +43,14 @@
assert media_info["custom_property"], "This media should have a custom property"
end
end

it 'should delete an uploaded video' do
with_a_cassette("limelight delete io") do
video = @limelight.upload(sample_mp4_file, title: 'test')

@limelight.delete_media(video["media_id"])
media_info = @limelight.media_info(video["media_id"])
assert media_info["errors"], "Unrecognized resource"
end
end
end

0 comments on commit e7ce830

Please sign in to comment.