Commit 62b7b33e by lanrion

added media_spec.rb

parent 904c7b4b
require "spec_helper"
describe WeixinAuthorize::Api::Media do
let(:image_path) do
"#{File.dirname(__FILE__)}/medias/dlogo.png"
end
let(:image_file) do
File.new(image_path)
end
it "can upload a image" do
response = $client.upload_media(image_file, "image")
expect(response.keys).to eq(["type", "media_id", "created_at"])
end
it "#download_media" do
image = $client.upload_media(image_file, "image")
media_id = image["media_id"]
response = $client.download_media(media_id)
binding.pry
expect(response.raw_headers.keys).to eq(["server",
"date",
"content-type",
"connection",
"content-disposition",
"cache-control",
"content-length"])
end
end
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