Permalink
Browse files

add setPreset api method

  • Loading branch information...
1 parent b093ffe commit d299d2755c576b782f2619e0e6dabbad5a78d8f2 @dsgh committed Aug 25, 2011
Showing with 23 additions and 0 deletions.
  1. +10 −0 lib/vimeo/advanced/video.rb
  2. +4 −0 test/fixtures/advanced/video/set_preset.json
  3. +9 −0 test/vimeo/advanced/videos_test.rb
@@ -125,6 +125,16 @@ class Video < Vimeo::Advanced::Base
"vimeo.videos.comments.getList",
:required => [:video_id],
:optional => [:page, :per_page]
+
+ # embed
+ # getPresets has a bug right now: the response is blank http://www.vimeo.com/forums/topic:32411
+ # create_api_method :get_presets,
+ # "vimeo.videos.embed.getPresets",
+ # :optional => [:page, :per_page]
+
+ create_api_method :set_preset,
+ "vimeo.videos.embed.setPreset",
+ :required => [:preset_id, :video_id]
end # Video
end # Advanced
@@ -0,0 +1,4 @@
+{
+ "generated_in":"0.4800",
+ "stat":"ok"
+}
@@ -198,6 +198,15 @@ class VideoTest < Test::Unit::TestCase
assert_equal "ok", response["stat"]
end
+
+ # embed
+
+ should "be able to set a preset" do
+ stub_post("?preset_id=preset_id&video_id=video_id&api_key=12345&format=json&method=vimeo.videos.embed.getPresets&api_sig=ed4c2455eabcaad041d44b659b002ff8", "advanced/video/set_preset.json")
+ response = @video.set_preset("preset_id", "video_id")
+
+ assert_equal "ok", response["stat"]
+ end
end
end

0 comments on commit d299d27

Please sign in to comment.