spec/paymill/request/base_spec.rb in paymill-0.4.0 vs spec/paymill/request/base_spec.rb in paymill-0.5.0
- old
+ new
@@ -1,20 +1,12 @@
require "spec_helper"
describe Paymill::Request::Base do
context "#perform" do
- it "checks for an api key" do
- Paymill.stub(:api_key).and_return(nil)
-
- expect{
- Paymill::Request::Base.new(nil).perform
- }.to raise_error Paymill::AuthenticationError
- end
-
it "performs an https request" do
Paymill.stub(:api_key).and_return("some key")
- connection = stub
- validator = stub
+ connection = double
+ validator = double
Paymill::Request::Connection.stub(:new).and_return(connection)
Paymill::Request::Validator.stub(:new).and_return(validator)
connection.should_receive(:setup_https)
connection.should_receive(:request)