Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add one more test for mochiweb_request:accepted_content_types/1

  • Loading branch information...
commit a2e3bb5e9916ff83012fa79fac5e2d205b77c235 1 parent 68fd47d
@fdmanana fdmanana authored
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.
Please sign in to comment.
Something went wrong with that request. Please try again.