spec/moiper/payment_spec.rb in moiper-0.1.0 vs spec/moiper/payment_spec.rb in moiper-0.1.1

- old
+ new

@@ -102,7 +102,22 @@ it { doc.at_css("Valores > Valor").text.should eq "1.99"} it { doc.at_css("Valores > Valor").attributes["moeda"].value.should eq "BRL"} it { doc.at_css("InstrucaoUnica > URLRetorno").text.should eq "http://example.org/thank_you" } it { doc.at_css("InstrucaoUnica > URLNotificacao").text.should eq "http://example.org/moip/notification" } + + context "when no id is informed" do + before { payment.id = nil } + it { doc.at_css("InstrucaoUnica > IdProprio").should be_nil } + end + + context "when no notification_url is informed" do + before { payment.notification_url = nil } + it { doc.at_css("InstrucaoUnica > URLNotificacao").should be_nil } + end + + context "when no return_url is informed" do + before { payment.return_url = nil } + it { doc.at_css("InstrucaoUnica > URLRetorno").should be_nil } + end end end