spec/integration/braintree/subscription_spec.rb in braintree-2.32.1 vs spec/integration/braintree/subscription_spec.rb in braintree-2.33.0
- old
+ new
@@ -11,11 +11,11 @@
}
).credit_cards[0]
end
describe "self.create" do
- it "is successful with a miniumum of params" do
+ it "is successful with a minimum of params" do
result = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
:plan_id => SpecHelper::TriallessPlan[:id]
)
@@ -623,16 +623,18 @@
result = Braintree::Subscription.create(
:payment_method_token => @credit_card.token,
:plan_id => SpecHelper::TriallessPlan[:id],
:descriptor => {
:name => 'badcompanyname12*badproduct12',
- :phone => '%bad4445555'
+ :phone => '%bad4445555',
+ :url => "12345678901234"
}
)
result.success?.should == false
result.errors.for(:subscription).for(:descriptor).on(:name)[0].code.should == Braintree::ErrorCodes::Descriptor::NameFormatIsInvalid
result.errors.for(:subscription).for(:descriptor).on(:phone)[0].code.should == Braintree::ErrorCodes::Descriptor::PhoneFormatIsInvalid
+ result.errors.for(:subscription).for(:descriptor).on(:url)[0].code.should == Braintree::ErrorCodes::Descriptor::UrlFormatIsInvalid
end
end
end
describe "self.create!" do
@@ -738,16 +740,18 @@
it "allows chaning the descriptors" do
result = Braintree::Subscription.update(@subscription.id,
:descriptor => {
:name => 'aaa*1234',
- :phone => '3334443333'
+ :phone => '3334443333',
+ :url => "ebay.com"
}
)
result.success?.should == true
result.subscription.descriptor.name.should == 'aaa*1234'
result.subscription.descriptor.phone.should == '3334443333'
+ result.subscription.descriptor.url.should == 'ebay.com'
end
context "when successful" do
it "returns a success response with the updated subscription if valid" do
new_id = rand(36**9).to_s(36)