* Update config default; Copy non-defaults * Update .stylish-haskell config version to match pgrst * Apply stylish haskell to all files * CircleCI config * Remove redundant import. What is used from Network.HTTP.Types.Headers is also exported by Network.HTTP.Types. * Grouped imports * Show un-styled files on CircleCI failure * Fix styling imports * Apply adhoc standard correctly
26 lines
680 B
Haskell
26 lines
680 B
Haskell
module Feature.UnicodeSpec where
|
|
|
|
import Control.Monad (void)
|
|
import Network.Wai (Application)
|
|
|
|
import Test.Hspec
|
|
import Test.Hspec.Wai
|
|
import Test.Hspec.Wai.JSON
|
|
|
|
import Protolude hiding (get)
|
|
import SpecHelper
|
|
|
|
spec :: SpecWith Application
|
|
spec =
|
|
describe "Reading and writing to unicode schema and table names" $
|
|
it "Can read and write values" $ do
|
|
get "/%D9%85%D9%88%D8%A7%D8%B1%D8%AF"
|
|
`shouldRespondWith` "[]"
|
|
|
|
void $ post "/%D9%85%D9%88%D8%A7%D8%B1%D8%AF"
|
|
[json| { "هویت": 1 } |]
|
|
|
|
get "/%D9%85%D9%88%D8%A7%D8%B1%D8%AF"
|
|
`shouldRespondWith` [json| [{ "هویت": 1 }] |]
|
|
{ matchHeaders = [matchContentTypeJson] }
|