Skip to content

Commit

Permalink
Merge 3bd7a09 into 9c5dc87
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Sep 24, 2014
2 parents 9c5dc87 + 3bd7a09 commit 92f537c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scotty.cabal
Expand Up @@ -99,7 +99,7 @@ test-suite spec
lifted-base,
wai,
hspec2,
hspec-wai >= 0.4.1,
hspec-wai >= 0.5,
scotty
GHC-options: -Wall -fno-warn-orphans

Expand Down
10 changes: 5 additions & 5 deletions test/Web/ScottySpec.hs
Expand Up @@ -98,11 +98,11 @@ spec = do
get "/scotty" `shouldRespondWith` modernGreekText

it "sets Content-Type header to \"text/plain; charset=utf-8\"" $ do
get "/scotty" `shouldRespondWith` 200 {matchHeaders = [("Content-Type", "text/plain; charset=utf-8")]}
get "/scotty" `shouldRespondWith` 200 {matchHeaders = ["Content-Type" <:> "text/plain; charset=utf-8"]}

withApp (Scotty.get "/scotty" $ setHeader "Content-Type" "text/somethingweird" >> text modernGreekText) $ do
it "doesn't override a previously set Content-Type header" $ do
get "/scotty" `shouldRespondWith` 200 {matchHeaders = [("Content-Type", "text/somethingweird")]}
get "/scotty" `shouldRespondWith` 200 {matchHeaders = ["Content-Type" <:> "text/somethingweird"]}

describe "html" $ do
let russianLanguageTextInHtml :: IsString a => a
Expand All @@ -113,13 +113,13 @@ spec = do
get "/scotty" `shouldRespondWith` russianLanguageTextInHtml

it "sets Content-Type header to \"text/html; charset=utf-8\"" $ do
get "/scotty" `shouldRespondWith` 200 {matchHeaders = [("Content-Type", "text/html; charset=utf-8")]}
get "/scotty" `shouldRespondWith` 200 {matchHeaders = ["Content-Type" <:> "text/html; charset=utf-8"]}

withApp (Scotty.get "/scotty" $ setHeader "Content-Type" "text/somethingweird" >> html russianLanguageTextInHtml) $ do
it "doesn't override a previously set Content-Type header" $ do
get "/scotty" `shouldRespondWith` 200 {matchHeaders = [("Content-Type", "text/somethingweird")]}
get "/scotty" `shouldRespondWith` 200 {matchHeaders = ["Content-Type" <:> "text/somethingweird"]}

describe "json" $ do
withApp (Scotty.get "/scotty" $ setHeader "Content-Type" "text/somethingweird" >> json (Just (5::Int))) $ do
it "doesn't override a previously set Content-Type header" $ do
get "/scotty" `shouldRespondWith` 200 {matchHeaders = [("Content-Type", "text/somethingweird")]}
get "/scotty" `shouldRespondWith` 200 {matchHeaders = ["Content-Type" <:> "text/somethingweird"]}

0 comments on commit 92f537c

Please sign in to comment.