Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanRada committed Dec 19, 2013
1 parent 0766474 commit 603d78f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 12 additions & 4 deletions spec/lib/washout_builder/dispatcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
soap_action 'dispatcher_method', :args => nil, :return => nil

def dispatcher_method
raise SOAPError.new("some message", 1001)
#nothing
end
end

Expand All @@ -23,9 +23,17 @@ def dispatcher_method
WashoutBuilder::Document::Generator.expects(:new).with(
:config => ApiController.soap_config,
:service_class => ApiController,
:soap_actions => {'dispatcher_method' =>
{:args => nil, :return => nil, :in => [], :out => [],:builder_in => [], :builder_out => [], :to => 'dispatcher_method'}
}
:soap_actions => {"dispatcher_method"=>{
:args=>nil,
:return=>nil,
:in=>[],
:out=>[],
:to=>"dispatcher_method",
:response_tag=>"tns:dispatcher_methodResponse",
:builder_in=>[],
:builder_out=>[]
}
}
)
get :_generate_doc
end
Expand Down
16 changes: 8 additions & 8 deletions spec/lib/washout_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
describe WashoutBuilder do

before(:each) do
WashOut::Rails::Engine.config.wash_out[:wsdl_style] = 'rpc'
WashOut::Rails::Engine.config.wash_out[:parser] = :nokogiri
WashOut::Rails::Engine.config.wash_out[:catch_xml_errors] = true
WashOut::Rails::Engine.config.wash_out[:camelize_wsdl] = "lower"
WashOut::Engine.config.wash_out[:wsdl_style] = 'rpc'
WashOut::Engine.config.wash_out[:parser] = :nokogiri
WashOut::Engine.config.wash_out[:catch_xml_errors] = true
WashOut::Engine.config.wash_out[:camelize_wsdl] = "lower"
end

let :nori do
Expand Down Expand Up @@ -558,20 +558,20 @@ def bad2
end

lambda { savon(:bad) }.should raise_exception(
WashOut::ProgrammerError,
WashOut::Dispatcher::ProgrammerError,
/SOAP response .*wyldness.*Array.*Hash.*stallion/
)

lambda { savon(:bad2) }.should raise_exception(
WashOut::ProgrammerError,
WashOut::Dispatcher::ProgrammerError,
/SOAP response .*oops.*String.*telephone_booths.*Array/
)
end

context "custom exceptions" do
let(:error_message) { "some message" }
let(:error_code) { 1001 }
let(:soap_exception) { SOAPError.new(error_message,error_code) }
let(:soap_exception) { WashOut::Dispatcher::SOAPError.new(error_message,error_code) }

before(:each) do
# Savon::Response.raise_errors = false
Expand All @@ -582,7 +582,7 @@ def bad2
soap_action 'bad', :args => nil, :return => nil

def bad
raise SOAPError.new("some message", 1001)
raise WashOut::Dispatcher::SOAPError.new("some message", 1001)
end
end

Expand Down

0 comments on commit 603d78f

Please sign in to comment.