Sha256: 77ef9dfd4c48750ad6194f1a0dd9af25d7941e87225baaa327d474060797e5c9
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
require 'spec_helper' describe "Base", :vcr, class: Pin::Base do before(:each) do @test_pin = Pin::Base.new(key: "W_VrFld7oc9BnC4pOdQxmw", env: :test) end it "should set key correctly" do @pin = Pin::Base.new(key: "KEY", env: :live) expect(@pin.key).to eq "KEY" end it "should set environment to live if no env set" do @pin = Pin::Base.new(key: "KEY", env: :live) expect(@pin.uri).to eq "https://api.pin.net.au/1/" end it "should set environment to test when set" do expect(@test_pin.uri).to eq "https://test-api.pin.net.au/1/" end it "should raise an error if anything other than '' :live or :test is passed to a new instance" do expect{Pin::Base.new(key: "KEY", env: :foo)}.to raise_error(RuntimeError, "'env' option must be :live or :test. Leave blank for live payments") end it "should list succesfully connect to Pin" do stub_request(:get, "https://#{@test_pin.key}:''@test-api.pin.net.au/1/customers") expect(Pin::Base.auth_get('customers').code).to eq 200 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pin_up-0.1.0 | spec/base_spec.rb |