diff options
author | Azul <azul@riseup.net> | 2012-09-27 22:33:04 +0200 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-09-27 22:33:04 +0200 |
commit | e17a2a676e0ce585ef9eaa9077887bfe1bc1173f (patch) | |
tree | e9984326f2d205d948d0cd3ab8c39aa72cf8af08 /core/lib/extensions | |
parent | 7ea11431db5b2ef93cb3caaa8909b742a1b72f8a (diff) |
added in leap web core - merging repos
Diffstat (limited to 'core/lib/extensions')
-rw-r--r-- | core/lib/extensions/testing.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/core/lib/extensions/testing.rb b/core/lib/extensions/testing.rb new file mode 100644 index 0000000..14a5698 --- /dev/null +++ b/core/lib/extensions/testing.rb @@ -0,0 +1,24 @@ +module LeapWebCore + module AssertResponses + + def assert_attachement_filename(name) + assert_equal %Q(attachment; filename="#{name}"), + @response.headers["Content-Disposition"] + end + + + def assert_json_response(object) + object.stringify_keys! if object.respond_to? :stringify_keys! + assert_equal object, JSON.parse(@response.body) + end + + end +end + +class ::ActionController::TestCase + include LeapWebCore::AssertResponses +end + +class ::ActionDispatch::IntegrationTest + include LeapWebCore::AssertResponses +end |