spec/rack/test/utils_spec.rb in rack-test-0.4.2 vs spec/rack/test/utils_spec.rb in rack-test-0.5.0

- old
+ new

@@ -56,12 +56,12 @@ "CONTENT_LENGTH" => data.length.to_s, :input => StringIO.new(data) } env = Rack::MockRequest.env_for("/", options) params = Rack::Utils::Multipart.parse_multipart(env) - params["submit-name"].should == "Larry" - params["files"][:filename].should == "foo.txt" + check params["submit-name"].should == "Larry" + check params["files"][:filename].should == "foo.txt" params["files"][:tempfile].read.should == "bar\n" end it "builds nested multipart bodies" do files = Rack::Test::UploadedFile.new(multipart_file("foo.txt")) @@ -72,11 +72,11 @@ "CONTENT_LENGTH" => data.length.to_s, :input => StringIO.new(data) } env = Rack::MockRequest.env_for("/", options) params = Rack::Utils::Multipart.parse_multipart(env) - params["people"][0]["submit-name"].should == "Larry" - params["people"][0]["files"][:filename].should == "foo.txt" + check params["people"][0]["submit-name"].should == "Larry" + check params["people"][0]["files"][:filename].should == "foo.txt" params["people"][0]["files"][:tempfile].read.should == "bar\n" end it "should return nil if no UploadedFiles were used" do data = build_multipart("people" => [{"submit-name" => "Larry", "files" => "contents"}])