summaryrefslogtreecommitdiff
path: root/core/lib
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-11-26 12:16:53 +0100
committerAzul <azul@leap.se>2012-11-26 12:16:53 +0100
commit1ea7da1314a46a87512e4f3d7f99249883f4f12f (patch)
treeab07f2e702b5f5eee9638ef751669f88298faad2 /core/lib
parent716dc248e940be8bd323a9d92f98785737fc99a0 (diff)
parentcdda8f095d49cdda94c3527ecb92cb15c300327b (diff)
Merge branch 'feature/users-change-passwords' into develop
Diffstat (limited to 'core/lib')
-rw-r--r--core/lib/extensions/testing.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/lib/extensions/testing.rb b/core/lib/extensions/testing.rb
index 86a059f..925c023 100644
--- a/core/lib/extensions/testing.rb
+++ b/core/lib/extensions/testing.rb
@@ -15,10 +15,18 @@ module LeapWebCore
end
def assert_json_response(object)
- object.stringify_keys! if object.respond_to? :stringify_keys!
- assert_equal object, JSON.parse(get_response.body)
+ if object.is_a? Hash
+ object.stringify_keys! if object.respond_to? :stringify_keys!
+ assert_equal object, JSON.parse(get_response.body)
+ else
+ assert_equal object.to_json, get_response.body
+ end
end
+ def assert_json_error(object)
+ object.stringify_keys! if object.respond_to? :stringify_keys!
+ assert_json_response :errors => object
+ end
end
end