diff options
author | jessib <jessib@riseup.net> | 2013-04-25 10:03:20 -0700 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2013-04-25 10:03:20 -0700 |
commit | 15d48c24e529e2f944b026749c5eb35eb4c5cfa7 (patch) | |
tree | 071ec86c0fbd85cce8cef0a417423ee8e99c39f0 /core/lib/extensions | |
parent | 4927abe188c7615fe6844ae0e20144b116a52a99 (diff) | |
parent | 53e3198196033f2dd77c09be6919cbef72f3f5d8 (diff) |
Merge pull request #40 from azul/feature/token-auth
Token auth with a database of it's own
Diffstat (limited to 'core/lib/extensions')
-rw-r--r-- | core/lib/extensions/testing.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/lib/extensions/testing.rb b/core/lib/extensions/testing.rb index 925c023..aad7fc1 100644 --- a/core/lib/extensions/testing.rb +++ b/core/lib/extensions/testing.rb @@ -14,10 +14,17 @@ module LeapWebCore get_response.headers["Content-Disposition"] end + def json_response + response = JSON.parse(get_response.body) + response.respond_to?(:with_indifferent_access) ? + response.with_indifferent_access : + response + end + def assert_json_response(object) if object.is_a? Hash object.stringify_keys! if object.respond_to? :stringify_keys! - assert_equal object, JSON.parse(get_response.body) + assert_equal object, json_response else assert_equal object.to_json, get_response.body end |