2021-07-30 14:33:06 +03:00
|
|
|
module Hasura.SessionSpec (spec) where
|
|
|
|
|
2021-09-24 01:56:37 +03:00
|
|
|
import Hasura.Prelude
|
2022-02-22 18:32:36 +03:00
|
|
|
import Hasura.QuickCheck.Instances ()
|
|
|
|
import Hasura.Server.Utils (isSessionVariable)
|
|
|
|
import Hasura.Session (sessionVariableToText)
|
|
|
|
import Test.Hspec (Spec, describe, shouldSatisfy)
|
|
|
|
import Test.Hspec.QuickCheck (prop)
|
2021-07-30 14:33:06 +03:00
|
|
|
|
|
|
|
spec :: Spec
|
|
|
|
spec = describe "SessionVariable" $ do
|
2021-09-24 01:56:37 +03:00
|
|
|
prop "Arbitrary instance generates valid session variables" $ \v ->
|
|
|
|
sessionVariableToText v `shouldSatisfy` isSessionVariable
|