spec/epayco/client/charge_spec.rb in epayco-0.0.2 vs spec/epayco/client/charge_spec.rb in epayco-0.0.3
- old
+ new
@@ -1,10 +1,10 @@
require File.expand_path('../../../spec_helper', __FILE__)
describe EPayCo::Client do
- let(:public_key){ '111111111111111' }
- let(:private_key){ '222222222222222' }
+ let(:public_key){ '1111111aaa11111111' }
+ let(:private_key){ '2222222bbb22222222' }
let(:client) { EPayCo::Client.new(:public_key => public_key, :private_key => private_key) }
# TODO: Make tests for erros
describe ".charge_create" do
let(:charge_params) { {
@@ -25,16 +25,16 @@
currency: "COP",
dues: "12"
} }
before do
- stub_post("recurring/v1/charge/create").
- with(:headers => {'Accept'=>'application/json; charset=utf-8;', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>'EPayCo Ruby Gem 0.0.1'}).
+ stub_post("payment/v1/charge/create").
+ with(:headers => {'Accept'=>'application/json; charset=utf-8;', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type'=>'application/json', 'User-Agent'=>"EPayCo Ruby Gem #{EPayCo::VERSION}"}).
to_return(:status => 200, :body => fixture("charge_create.json"), :headers => {:content_type => "application/json;"})
@response = client.charge_create(charge_params)
end
- it { expect(a_post("recurring/v1/charge/create")).to have_been_made }
+ it { expect(a_post("payment/v1/charge/create")).to have_been_made }
it { expect(@response).to be_a(Hashie::Mash) }
it { expect(@response.status).to eq "Creado" }
end
end