From 60f05fb3a68aabe86820cb3d77e369e1b5940d99 Mon Sep 17 00:00:00 2001 From: Nikolai B Date: Fri, 4 Dec 2015 18:03:32 +0000 Subject: [PATCH] Remove root and instance_options for active model serializers 1.0.x compatability --- lib/rocket_pants/rspec_matchers.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/rocket_pants/rspec_matchers.rb b/lib/rocket_pants/rspec_matchers.rb index cb2ae1a..4d40fea 100644 --- a/lib/rocket_pants/rspec_matchers.rb +++ b/lib/rocket_pants/rspec_matchers.rb @@ -10,11 +10,14 @@ def self.normalised_error(e) end end + KEYS_TO_DELETE = %w(url root instance_options).freeze def self.normalise_urls(object) if object.is_a?(Array) - object.each { |o| o['url'] = nil } + object.each do |o| + KEYS_TO_DELETE.each { |key| o[key] = nil } + end elsif object.is_a?(Hash) || (defined?(APISmith::Smash) && object.is_a?(APISmith::Smash)) - object['url'] = nil + KEYS_TO_DELETE.each { |key| object[key] = nil } end object end