From e17a2a676e0ce585ef9eaa9077887bfe1bc1173f Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 27 Sep 2012 22:33:04 +0200 Subject: added in leap web core - merging repos --- core/lib/extensions/testing.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 core/lib/extensions/testing.rb (limited to 'core/lib/extensions') 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 -- cgit v1.2.3