Skip to content

Commit

Permalink
fix test specs
Browse files Browse the repository at this point in the history
  • Loading branch information
why404 committed Feb 14, 2014
1 parent d83b948 commit 91d3ca2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/qiniu/policy/put_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@

context '.token' do
it 'should works' do
expect_uptoken = 'access_key:kyLwxo3HWXBn7ZY884IpS_DVjuM=:eyJkZWFkbGluZSI6MCwic2NvcGUiOiJteV92aWRlb19idWNrZXQifQ=='
# cuz json string no sort
expected_result = [
'access_key:kyLwxo3HWXBn7ZY884IpS_DVjuM=:eyJkZWFkbGluZSI6MCwic2NvcGUiOiJteV92aWRlb19idWNrZXQifQ==',
'access_key:wyz1S9nF7Sg-KWyQqn6UxjSr4kY=:eyJzY29wZSI6Im15X3ZpZGVvX2J1Y2tldCIsImRlYWRsaW5lIjowfQ=='
]
mac = Qiniu::Kit::Mac.new('access_key', 'secret_key')
put_policy = Qiniu::Policy::Put.new(mac) do |f|
# let ruby 1.8.x and ruby 1.9.x both follow the in insertion order
f.deadline = 0
f.scope = 'my_video_bucket'
end
put_policy.token.should eq(expect_uptoken)
result = put_policy.token
expected_result.include?(result).should be_true
end
end

Expand Down

0 comments on commit 91d3ca2

Please sign in to comment.