Skip to content
Browse files

Refactor params rejection spec for confirm_resource

  • Loading branch information...
1 parent 834808e commit 808cb6645b90b48062c6af68205ac0ad2a94b149 @alan alan committed Jan 17, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 spec/client_spec.rb
View
7 spec/client_spec.rb
@@ -262,8 +262,11 @@
end
it "rejects other params not required for the signature" do
- # Once for confirm, once to fetch result
- @client.expects(:request).twice.returns(stub(:parsed => {}))
+ @client.stubs(:request).returns(stub(:parsed => {}))
+ @client.expects(:signature_valid?).returns(true).with(hash) do |hash|
+ !hash.keys.include?(:foo) && !hash.keys.include?('foo')
+ end
+
@client.confirm_resource(@client.send(:sign_params, @params).merge('foo' => 'bar'))
end

0 comments on commit 808cb66

Please sign in to comment.
Something went wrong with that request. Please try again.