lib/rspec-api/dsl/resource.rb in rspec-api-0.1.0 vs lib/rspec-api/dsl/resource.rb in rspec-api-0.1.1

- old
+ new

@@ -11,10 +11,11 @@ end end define_action :get define_action :put + define_action :patch define_action :post define_action :delete def has_attribute(name, type, options = {}) parent = (@attribute_ancestors || []).inject(rspec_api) {|chain, step| chain[:attributes][step]} @@ -30,10 +31,10 @@ rspec_api[:sort] = {parameter: sort_parameter, attribute: options[:on]} end # TODO: the second 'accepts_filter' should not override the first, but add def accepts_filter(filter_parameter, options={}) - rspec_api[:filter] = {parameter: filter_parameter, attribute: options[:on]} + rspec_api[:filter] = options.merge(name: filter_parameter) end private def nested_attribute(name)