summaryrefslogtreecommitdiff
path: root/core/lib
diff options
context:
space:
mode:
authorjessib <jessib@leap.se>2012-11-26 10:15:22 -0800
committerjessib <jessib@leap.se>2012-11-26 10:15:22 -0800
commit3e744e4e226eae3ea2f900d9fccc32b6c046d65f (patch)
tree1b19232d08229b178c094c92e2242ce1686099ae /core/lib
parentd9d67bd60d3fdfa4106977de9e5aba11f659fc79 (diff)
parentbf74255d1530fe5852dc6e6c27ef975ce9aa8d3c (diff)
Merge branch 'develop' into help_develop
Conflicts: users/app/views/sessions/_nav.html.haml
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