Permalink
Browse files

Add one more test for mochiweb_request:accepted_content_types/1

  • Loading branch information...
1 parent 68fd47d commit a2e3bb5e9916ff83012fa79fac5e2d205b77c235 @fdmanana fdmanana committed Jun 21, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/mochiweb_request_tests.erl
View
7 src/mochiweb_request_tests.erl
@@ -141,6 +141,11 @@ accepted_content_types_test() ->
Req8 = mochiweb_request:new(nil, 'GET', "/foo", {1, 1},
mochiweb_headers:make([{"Accept", "text/html"}])),
?assertEqual([],
- Req8:accepted_content_types(["application/json"])).
+ Req8:accepted_content_types(["application/json"])),
+
+ Req9 = mochiweb_request:new(nil, 'GET', "/foo", {1, 1},
+ mochiweb_headers:make([{"Accept", "text/*;q=0.9, text/html;q=0.5, */*;q=0.7"}])),
+ ?assertEqual(["application/json", "text/html"],
+ Req9:accepted_content_types(["text/html", "application/json"])).
-endif.

0 comments on commit a2e3bb5

Please sign in to comment.