lib/soaspec/exchange_handlers/rest_handler.rb in soaspec-0.2.1 vs lib/soaspec/exchange_handlers/rest_handler.rb in soaspec-0.2.2

- old
+ new

@@ -8,14 +8,12 @@ require_relative '../interpreter' require 'json' require 'jsonpath' require 'nori' require 'erb' -require 'hashie/extensions/indifferent_access' module Soaspec - # Wraps around Savon client defining default values dependent on the soap request class RestHandler < ExchangeHandler extend Soaspec::RestParameters include Soaspec::RestParametersDefaults extend Soaspec::RestExchangeFactory @@ -261,9 +259,10 @@ def post_data(test_values) data = if @request_option == :hash && test_values[:body] test_values[:payload] = JSON.generate(hash_used_in_request(test_values[:body])).to_s elsif @request_option == :template test_values = test_values[:body].dup if test_values[:body] + test_values = IndifferentHash.new(test_values) # Allow test_values to be either Symbol or String Soaspec::TemplateReader.new.render_body(template_name, binding) else test_values[:payload] end # Soaspec::SpecLogger.info "Request Empty for '#{@request_option}'" if data.strip.empty?