Sha256: 6ecc276f0367898f1ca3d2ac0567faa9a174f0f3e0357cde158434e818c16fe0
Contents?: true
Size: 621 Bytes
Versions: 20
Compression:
Stored size: 621 Bytes
Contents
# encoding: utf-8 require "spec_helper" describe Her::Middleware::SecondLevelParseJSON do subject { described_class.new } let(:body) { "{\"data\": 1, \"errors\": 2, \"metadata\": 3}" } it "parses body as json" do subject.parse(body).tap do |json| json[:data].should == 1 json[:errors].should == 2 json[:metadata].should == 3 end end it "parses :body key as json in the env hash" do env = { :body => body } subject.on_complete(env) env[:body].tap do |json| json[:data].should == 1 json[:errors].should == 2 json[:metadata].should == 3 end end end
Version data entries
20 entries across 20 versions & 2 rubygems