mirror of
https://github.com/wahyd4/ruby-sdk.git
synced 2026-08-09 12:56:21 +10:00
updated watermark tests
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
|
||||
require 'spec_helper'
|
||||
require 'qiniu/rs/io'
|
||||
require 'qiniu/rs/pub'
|
||||
require 'qiniu/rs/eu'
|
||||
|
||||
module Qiniu
|
||||
@@ -9,8 +11,31 @@ module Qiniu
|
||||
|
||||
before :all do
|
||||
@customer_id = "awhy.xu@gmail.com"
|
||||
@bucket = "wm_test_bucket"
|
||||
@key = "image_logo_for_test.png"
|
||||
|
||||
local_file = File.expand_path('../' + @key, __FILE__)
|
||||
upopts = {:scope => @bucket, :expires_in => 3600, :customer => @customer_id}
|
||||
uptoken = Qiniu::RS.generate_upload_token(upopts)
|
||||
|
||||
code, data = Qiniu::RS::IO.upload_with_token(uptoken, local_file, @bucket, @key, nil, nil, nil, true)
|
||||
code.should == 200
|
||||
puts data.inspect
|
||||
|
||||
code2, data2 = Qiniu::RS::Pub.set_separator(@bucket, "-")
|
||||
code2.should == 200
|
||||
puts data2.inspect
|
||||
|
||||
code3, data3 = Qiniu::RS::Pub.set_style(@bucket, "small.jpg", "imageView/1/w/120/h/120/q/85/format/jpg/watermark/1")
|
||||
code3.should == 200
|
||||
puts data3.inspect
|
||||
end
|
||||
|
||||
#after :all do
|
||||
# result = Qiniu::RS.drop(@bucket)
|
||||
# result.should_not be_false
|
||||
#end
|
||||
|
||||
context ".set_watermark" do
|
||||
it "should works" do
|
||||
options = {
|
||||
|
||||
Reference in New Issue
Block a user