spec/comcetera_spec.rb in comcetera-1.0.0 vs spec/comcetera_spec.rb in comcetera-1.0.1

- old
+ new

@@ -1,22 +1,13 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper') -FakeWeb.register_uri :get, 'http://api.comcetera.com/npl?user=username&pass=password&msisdn=31612345678', :body=> <<-MSG -QUERYOK -31612345678 12345 -ENDBATCH -MSG -FakeWeb.register_uri :get, 'http://api.comcetera.com/npl?user=username&pass=password&msisdn=31612345621', :body=> <<-MSG -QUERYOK -31612345621 ERR21 -ENDBATCH -MSG - describe "Comcetera" do before(:all) do Comcetera.username = "username" Comcetera.password = "password" + Comcetera.setup_fakeweb_response(:msisdn=>31612345678, :result => 12345) + Comcetera.setup_fakeweb_response(:msisdn=>31612345621, :result => "ERR21") end describe "detect" do it "should return a new Comcetera instance" do @comcetera = Comcetera.detect(31612345678) @@ -40,10 +31,10 @@ it "should contain the returned msisdn" do @comcetera.msisdn.should == "31612345678" end end - + it "should return an instance with error code and debug info when no operator code is returned" do @comcetera = Comcetera.detect(31612345621) @comcetera.operator_code.should be_nil @comcetera.error_code.should == "ERR21" @comcetera.error_message.should == "Facility not supported"