Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Delete channel #3

Merged
merged 2 commits into from almost 2 years ago

2 participants

Fernando Briano Bruno Aguirre
Fernando Briano

No description provided.

Bruno Aguirre

I think the recording didn't work as expected

Bruno Aguirre elcuervo merged commit 980fc98 into from
Bruno Aguirre elcuervo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
6 lib/limelight_video.rb
@@ -84,6 +84,12 @@ def publish_channel(id)
84 84 JSON.parse response.body
85 85 end
86 86
  87 + def delete_channel(channel_id)
  88 + # http://api.videoplatform.limelight.com/rest/organizations/<org id>/channels/<channel id>
  89 + path = generate_encoded_path('delete', "#{@base_channels_url}/#{channel_id}")
  90 + @client.delete(path)
  91 + end
  92 +
87 93 def create_metadata(names)
88 94 # http://api.videoplatform.limelight.com/rest/organizations/<org id>/media/properties/custom/<property name>
89 95 Array(names).each do |name|
144 test/fixtures/cassettes/delete_a_channel.yml
... ... @@ -0,0 +1,144 @@
  1 +---
  2 +http_interactions:
  3 +- request:
  4 + method: post
  5 + uri: http://api.videoplatform.limelight.com/rest/organizations/889457f434f14057bdcc9a1f39bd9614/channels?access_key=5CIILY3Sw1P%2FqF2VHikRPXMEPdA%3D&expires=1342101365&signature=LibsMX11WOy%2BiTZlCc%2FBFSmX20fcRJ%2FmLxP8yYOdKZM%3D
  6 + body:
  7 + encoding: US-ASCII
  8 + string: title=deleted_channel
  9 + headers:
  10 + content-type:
  11 + - application/x-www-form-urlencoded
  12 + accept:
  13 + - ! '*/*'
  14 + user-agent:
  15 + - Ruby
  16 + connection:
  17 + - close
  18 + response:
  19 + status:
  20 + code: 201
  21 + message: Created
  22 + headers:
  23 + server:
  24 + - nginx/0.8.54
  25 + date:
  26 + - Thu, 12 Jul 2012 13:51:06 GMT
  27 + content-type:
  28 + - application/json; charset=utf-8
  29 + connection:
  30 + - close
  31 + cache-control:
  32 + - no-cache
  33 + status:
  34 + - 201 Created
  35 + x-runtime:
  36 + - 861ms
  37 + content-length:
  38 + - '404'
  39 + via:
  40 + - 1.0 vps-017.iad.llnw.net
  41 + body:
  42 + encoding: US-ASCII
  43 + string: ! '{"publish_date": null, "email_enabled": false, "thumbnail_url": "",
  44 + "description": null, "embed_enabled": false, "title": "deleted_channel", "channel_id":
  45 + "e24b0c51a5594feb96fba33088e1fd5d", "search_inside_enabled": false, "rss_enabled":
  46 + false, "create_date": 1342101066, "state": "NotPublished", "itunes_rss_enabled":
  47 + false, "autoplay_enabled": false, "update_date": 1342101066, "custom_property":
  48 + null}'
  49 + http_version: '1.1'
  50 + recorded_at: Thu, 12 Jul 2012 13:51:06 GMT
  51 +- request:
  52 + method: put
  53 + uri: http://api.videoplatform.limelight.com/rest/organizations/889457f434f14057bdcc9a1f39bd9614/channels/e24b0c51a5594feb96fba33088e1fd5d/properties?access_key=5CIILY3Sw1P%2FqF2VHikRPXMEPdA%3D&expires=1342101366&signature=p3qTfQv0A3U5%2FZ2Rnco7PAg5zlTThKUCnzlLwzcOl8Y%3D
  54 + body:
  55 + encoding: US-ASCII
  56 + string: state=Published
  57 + headers:
  58 + content-type:
  59 + - application/x-www-form-urlencoded
  60 + accept:
  61 + - ! '*/*'
  62 + user-agent:
  63 + - Ruby
  64 + connection:
  65 + - close
  66 + response:
  67 + status:
  68 + code: 200
  69 + message: OK
  70 + headers:
  71 + server:
  72 + - nginx/0.8.54
  73 + date:
  74 + - Thu, 12 Jul 2012 13:51:08 GMT
  75 + content-type:
  76 + - application/json; charset=utf-8
  77 + connection:
  78 + - close
  79 + cache-control:
  80 + - private, max-age=0, must-revalidate
  81 + status:
  82 + - 200 OK
  83 + x-runtime:
  84 + - 1340ms
  85 + etag:
  86 + - ! '"17002249e68fc34b2f3145e5683ff3b0"'
  87 + content-length:
  88 + - '407'
  89 + via:
  90 + - 1.0 vps-099.iad.llnw.net
  91 + body:
  92 + encoding: US-ASCII
  93 + string: ! '{"publish_date": 1342101068, "email_enabled": false, "thumbnail_url":
  94 + "", "description": null, "embed_enabled": false, "title": "deleted_channel",
  95 + "channel_id": "e24b0c51a5594feb96fba33088e1fd5d", "search_inside_enabled":
  96 + false, "rss_enabled": false, "create_date": 1342101066, "state": "Published",
  97 + "itunes_rss_enabled": false, "autoplay_enabled": false, "update_date": 1342101068,
  98 + "custom_property": null}'
  99 + http_version: '1.1'
  100 + recorded_at: Thu, 12 Jul 2012 13:51:08 GMT
  101 +- request:
  102 + method: delete
  103 + uri: http://api.videoplatform.limelight.com/rest/organizations/889457f434f14057bdcc9a1f39bd9614/channels/e24b0c51a5594feb96fba33088e1fd5d?access_key=5CIILY3Sw1P%2FqF2VHikRPXMEPdA%3D&expires=1342101368&signature=rhUqi8VJY%2FgapK5sCBKVODlhPjC2QaK2ZXdP6t7iH9M%3D
  104 + body:
  105 + encoding: US-ASCII
  106 + string: ''
  107 + headers:
  108 + accept:
  109 + - ! '*/*'
  110 + user-agent:
  111 + - Ruby
  112 + connection:
  113 + - close
  114 + response:
  115 + status:
  116 + code: 200
  117 + message: OK
  118 + headers:
  119 + server:
  120 + - nginx/0.8.54
  121 + date:
  122 + - Thu, 12 Jul 2012 13:51:09 GMT
  123 + content-type:
  124 + - application/json; charset=utf-8
  125 + connection:
  126 + - close
  127 + cache-control:
  128 + - private, max-age=0, must-revalidate
  129 + status:
  130 + - 200 OK
  131 + x-runtime:
  132 + - 464ms
  133 + etag:
  134 + - ! '"d751713988987e9331980363e24189ce"'
  135 + content-length:
  136 + - '2'
  137 + via:
  138 + - 1.0 vps-017.iad.llnw.net
  139 + body:
  140 + encoding: US-ASCII
  141 + string: ! '[]'
  142 + http_version: '1.1'
  143 + recorded_at: Thu, 12 Jul 2012 13:51:09 GMT
  144 +recorded_with: VCR 2.1.1
18 test/integration/limelight_test.rb
@@ -5,9 +5,9 @@
5 5 describe Limelight do
6 6 before do
7 7 @limelight = Limelight.new(
8   - organization: '889457f434f14057bdcc9a1f39bd9614',
9   - access_key: '5CIILY3Sw1P/qF2VHikRPXMEPdA=',
10   - secret: 'Frpgy2kz/xDAnrO3IBAWDRkNJ3s='
  8 + organization: '889457f434f14057bdcc9a1f39bd9614',
  9 + access_key: '5CIILY3Sw1P/qF2VHikRPXMEPdA=',
  10 + secret: 'Frpgy2kz/xDAnrO3IBAWDRkNJ3s='
11 11 )
12 12 end
13 13
@@ -63,4 +63,16 @@
63 63 assert_equal channel["state"], "Published"
64 64 end
65 65 end
  66 +
  67 + it 'should delete a channel' do
  68 + with_a_cassette('delete a channel') do
  69 + channel = @limelight.create_channel('deleted_channel')
  70 + channel = @limelight.publish_channel channel["channel_id"]
  71 + assert channel['channel_id']
  72 +
  73 +
  74 + channel = @limelight.delete_channel(channel["channel_id"])
  75 + assert channel.status, 200
  76 + end
  77 + end
66 78 end

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.