diff --git a/lib/wash_out/param.rb b/lib/wash_out/param.rb index 54dc3caf..1929eb70 100644 --- a/lib/wash_out/param.rb +++ b/lib/wash_out/param.rb @@ -61,13 +61,14 @@ def load(data, key) end else operation = case type - when 'string'; :to_s - when 'integer'; :to_i - when 'double'; :to_f - when 'boolean'; lambda{|dat| dat === "0" ? false : !!dat} - when 'date'; :to_date - when 'datetime'; :to_datetime - when 'time'; :to_time + when 'string'; :to_s + when 'integer'; :to_i + when 'double'; :to_f + when 'boolean'; lambda{|dat| dat === "0" ? false : !!dat} + when 'date'; :to_date + when 'datetime'; :to_datetime + when 'time'; :to_time + when 'base64Binary'; lambda{|dat| Base64.decode64(dat)} else raise RuntimeError, "Invalid WashOut simple type: #{type}" end diff --git a/spec/lib/wash_out_spec.rb b/spec/lib/wash_out_spec.rb index 01d74d23..af7d1e33 100644 --- a/spec/lib/wash_out_spec.rb +++ b/spec/lib/wash_out_spec.rb @@ -451,6 +451,19 @@ def date savon(:date, :value => '2000-12-30') lambda { savon(:date) }.should_not raise_exception end + + it "recognize base64Binary" do + mock_controller do + soap_action "base64", :args => :base64Binary, :return => :nil + def base64 + params[:value].should == 'test' unless params[:value].blank? + render :soap => nil + end + end + + savon(:base64, :value => Base64.encode64('test')) + lambda { savon(:base64) }.should_not raise_exception + end end context "errors" do