summaryrefslogtreecommitdiff
path: root/include/ut/http_utility_test.cpp
blob: d091248f8922c684762960f5e0d3c5cff7a0ad87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "http_utility.hpp"

#include <gtest/gtest.h>

namespace http_helpers
{
namespace
{

TEST(HttpUtility, requestPrefersHtml)
{
    EXPECT_FALSE(requestPrefersHtml("*/*, application/octet-stream"));
    EXPECT_TRUE(isOctetAccepted("*/*, application/octet-stream"));

    EXPECT_TRUE(requestPrefersHtml("text/html, application/json"));
    EXPECT_FALSE(isOctetAccepted("text/html, application/json"));

    EXPECT_FALSE(requestPrefersHtml("application/json"));
    EXPECT_FALSE(isOctetAccepted("application/json"));
}

} // namespace
} // namespace http_helpers