Commit daf34aa0 by lanrion

added #send_image_custom test

parent 69f0abf1
...@@ -5,6 +5,14 @@ describe WeixinAuthorize::Api::Custom do ...@@ -5,6 +5,14 @@ describe WeixinAuthorize::Api::Custom do
"text Custom message" "text Custom message"
end end
let(:image_path) do
"#{File.dirname(__FILE__)}/medias/ruby-logo.jpg"
end
let(:image_file) do
File.new(image_path)
end
it "#send_text_custom" do it "#send_text_custom" do
response = $client.send_text_custom(ENV["OPENID"], text_message) response = $client.send_text_custom(ENV["OPENID"], text_message)
expect(response["errcode"]).to eq(0) expect(response["errcode"]).to eq(0)
...@@ -28,8 +36,10 @@ describe WeixinAuthorize::Api::Custom do ...@@ -28,8 +36,10 @@ describe WeixinAuthorize::Api::Custom do
end end
it "#send_image_custom" do it "#send_image_custom" do
pending("The test must have a media_id") image = $client.upload_media(image_file, "image")
this_should_not_get_executed media_id = image["media_id"]
response = $client.send_image_custom(ENV["OPENID"], media_id)
expect(response["errcode"]).to eq(0)
end end
it "#send_video_custom" do it "#send_video_custom" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment