spec/language/negotiator_spec.rb in accept_headers-0.0.8 vs spec/language/negotiator_spec.rb in accept_headers-0.0.9

- old
+ new

@@ -67,9 +67,15 @@ language.new('en', 'us', q: 1) ] end end + describe "#to_s" do + it "returns a string of each language #to_s joined by a comma" do + subject.new("en-us, en-gb;q=0.9").to_s.must_equal "en-us;q=1,en-gb;q=0.9" + end + end + describe "negotiate supported languages" do it "returns a best matching language" do match = language.new('en', 'us') n = subject.new('en-*, en-us, *;q=0.8') n.negotiate('en-us').must_equal language.new('en', 'us')