spec/namba/namba_spec.rb in namba-1.0.0.1 vs spec/namba/namba_spec.rb in namba-1.0.1

- old
+ new

@@ -40,6 +40,20 @@ Namba.configure do |config| config.locale = :ru end }.should raise_error(Namba::ConfigurationError, "Available locales are only 'kg' and 'kz'") end + + it "should raise Invalid Response Error when status code is not 200" do + Namba.configure do |config| + config.username = "name" + config.password = "secret" + config.locale = :kz + end + + n = Namba.new() + + expect { + n.send(:get_response_from, "http://api.namba.#{n.locale}/404") + }.should raise_error(Namba::InvalidResponseError, "Invalid response from service") + end end