spec/moip2/accounts_api_spec.rb in moip2-1.2.1 vs spec/moip2/accounts_api_spec.rb in moip2-1.3.1

- old
+ new

@@ -142,21 +142,41 @@ end describe "#exists" do describe "with a registered tax document" do let(:existence_check) do - VCR.use_cassette("account_exists") do - accounts_api.exists?("436.130.670-21") + VCR.use_cassette("account_exists_for_tax_document") do + accounts_api.exists?({tax_document: "436.130.670-21"}) end end it { expect(existence_check).to be true } end describe "with a non registered tax document" do let(:existence_check) do - VCR.use_cassette("account_doesnt_exist") do - accounts_api.exists?("555.000.123-40") + VCR.use_cassette("account_doesnt_exist_for_tax_document") do + accounts_api.exists?({tax_document: "555.000.123-40"}) + end + end + + it { expect(existence_check).to be false } + end + + describe "with a registered email" do + let(:existence_check) do + VCR.use_cassette("account_exists_for_email") do + accounts_api.exists?({email: "dev.moip.1503312536@labs.moip.com.br"}) + end + end + + it { expect(existence_check).to be true } + end + + describe "with a non registered email" do + let(:existence_check) do + VCR.use_cassette("account_doesnt_exist_for_email") do + accounts_api.exists?({email: "dev.moip.0123456789@labs.moip.com.br"}) end end it { expect(existence_check).to be false } end