File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 228228
229229 it { is_expected . to eq "application/json" }
230230 end
231+
232+ context "when given with deprecated :mime_type option" do
233+ let ( :opts ) { { :mime_type => "application/json" } }
234+
235+ it "uses the value and emits a deprecation warning" do
236+ expect { expect ( form_file . content_type ) . to eq "application/json" }
237+ . to output ( /DEPRECATED/ ) . to_stderr
238+ end
239+ end
231240 end
232241
233242 describe "#mime_type" do
Original file line number Diff line number Diff line change 55
66 let ( :data ) { { "foo[bar]" => "test" } }
77
8+ it "raises ArgumentError when given a non-Hash top-level value" do
9+ expect { described_class . new ( 42 ) } . to raise_error ( HTTP ::FormData ::Error )
10+ end
11+
812 it "supports any Enumerables of pairs" do
913 form_data = described_class . new ( [ %w[ foo bar ] , [ "foo" , %w[ baz moo ] ] ] )
1014
4650 it { is_expected . to eq "foo[bar]=test" }
4751 end
4852
53+ context "with nil value" do
54+ let ( :data ) { { "foo" => nil } }
55+
56+ it { is_expected . to eq "foo" }
57+ end
58+
4959 it "rewinds content" do
5060 content = form_data . read
5161 expect ( form_data . to_s ) . to eq content
Original file line number Diff line number Diff line change 1515
1616SimpleCov . start do
1717 add_filter "/spec/"
18- minimum_coverage 80
18+ minimum_coverage 100
1919end
You can’t perform that action at this time.
0 commit comments