spec/creditsafe/client_spec.rb in creditsafe-0.3.2 vs spec/creditsafe/client_spec.rb in creditsafe-0.4.0
- old
+ new
@@ -125,15 +125,17 @@
let(:soap_verb) { 'find_companies' }
let(:client) { described_class.new(username: username, password: password) }
let(:country_code) { "GB" }
let(:registration_number) { "RN123" }
let(:city) { nil }
+ let(:postal_code) { nil }
let(:search_criteria) do
{
country_code: country_code,
registration_number: registration_number,
- city: city
+ city: city,
+ postal_code: postal_code
}.reject { |_, v| v.nil? }
end
subject(:find_company) { client.find_company(search_criteria) }
subject(:method_call) { find_company }
@@ -158,9 +160,19 @@
it { is_expected.to raise_error(ArgumentError) }
end
context "with a city" do
let(:city) { "Berlin" }
+ it { is_expected.to raise_error(ArgumentError) }
+
+ context "in Germany" do
+ let(:country_code) { "DE" }
+ it { is_expected.to_not raise_error }
+ end
+ end
+
+ context "with a postal_code" do
+ let(:postal_code) { "41199" }
it { is_expected.to raise_error(ArgumentError) }
context "in Germany" do
let(:country_code) { "DE" }
it { is_expected.to_not raise_error }