Sha256: 6f8ca084d7a3798a4135b054ca89ce3046336369f2897ac95f7ba472ba4da020
Contents?: true
Size: 627 Bytes
Versions: 1
Compression:
Stored size: 627 Bytes
Contents
# -*- coding: utf-8 -*- require 'minitest/autorun' Minitest::Test ||= MiniTest::Unit::TestCase require 'simplecov' SimpleCov.start require 'sixarm_ruby_action_dispatch_response_json' describe "ActionDispatchResponseJSONTest" do describe "#json" do it "gets the response body as json" do resp = ActionDispatch::Response.new resp.body = '{"a":"b"}' resp.json.must_equal({"a"=>"b"}) end end describe "#json=" do it "sets the response body from json" do resp = ActionDispatch::Response.new resp.json = {"a"=>"b"}.to_json resp.body.must_equal('{"a":"b"}') end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sixarm_ruby_action_dispatch_response_json-1.0.0 | test/sixarm_ruby_action_dispatch_response_json_test.rb |