spec/moip-assinaturas/payment_spec.rb in moip-assinaturas-0.5.1 vs spec/moip-assinaturas/payment_spec.rb in moip-assinaturas-0.6.0

- old
+ new

@@ -57,7 +57,15 @@ it "should get details of a payment" do request = Moip::Assinaturas::Payment.details(7, moip_auth: $custom_moip_auth) request[:success].should be_true request[:payment][:id].should == 7 end + + it "should raise exception from invalid oauth" do + expect{ Moip::Assinaturas::Payment.details(7, moip_auth: { oauth: {accessToken: "sefghjrs"}, sandbox: true})}.to raise_error Moip::Assinaturas::MissingTokenError + end + + it "shoul raise exception from nil oauth" do + expect{ Moip::Assinaturas::Payment.details(7, moip_auth: { oauth: {accessToken: ""}, sandbox: true })}.to raise_error Moip::Assinaturas::MissingTokenError + end end end \ No newline at end of file