spec/epayco/client/plans_spec.rb in epayco-0.0.2 vs spec/epayco/client/plans_spec.rb in epayco-0.0.3
- old
+ new
@@ -6,11 +6,11 @@
let(:client) { EPayCo::Client.new(:public_key => public_key, :private_key => private_key) }
describe ".plan_all" do
before do
stub_get("recurring/v1/plans/#{public_key}").
- 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'}).
+ 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("plan_all.json"), :headers => {:content_type => "application/json;"})
@plans = client.plan_all
end
it { expect(a_get("recurring/v1/plans/#{public_key}")).to have_been_made }
@@ -25,11 +25,11 @@
currency: "USD", interval: "year", interval_count: 1, trial_days: 0
} }
before do
stub_post("recurring/v1/plan/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'}).
+ 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("plan_create.json"), :headers => {:content_type => "application/json;"})
@response = client.plan_create(plan_params)
end
it { expect(a_post("recurring/v1/plan/create")).to have_been_made }
@@ -39,11 +39,11 @@
describe ".plan_details" do
let(:plan_id) { "test" }
before do
stub_get("recurring/v1/plan/#{public_key}/#{plan_id}").
- 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'}).
+ 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("plan_details.json"), :headers => {:content_type => "application/json;"})
@plan = client.plan_details(plan_id)
end
it { expect(a_get("recurring/v1/plan/#{public_key}/#{plan_id}")).to have_been_made }
@@ -57,10 +57,10 @@
id_plan: "test", name: "Prueba", description: "Plan de prueba", amount: 30,
currency: "USD", interval: "year", interval_count: 1, trial_days: 0
} }
before do
stub_put("recurring/v1/plan/edit/#{public_key}/#{plan_id}").
- 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'}).
+ 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("plan_update.json"), :headers => {:content_type => "application/json;"})
@response = client.plan_update(plan_id, plan_params)
end
it { expect(a_put("recurring/v1/plan/edit/#{public_key}/#{plan_id}")).to have_been_made }