fix(tests): explicit post parameter name for dummy login
This commit is contained in:
parent
9ba0e27ba2
commit
2ccd50fa85
@ -27,7 +27,7 @@ dummyForm :: ( RenderMessage (HandlerSite m) FormMessage
|
|||||||
) => AForm m (CI Text)
|
) => AForm m (CI Text)
|
||||||
dummyForm = wFormToAForm $ do
|
dummyForm = wFormToAForm $ do
|
||||||
mr <- getMessageRender
|
mr <- getMessageRender
|
||||||
aFormToWForm $ areq (ciField & addDatalist userList) (fslpI MsgDummyIdent (mr MsgDummyIdentPlaceholder) & noAutocomplete) Nothing
|
aFormToWForm $ areq (ciField & addDatalist userList) (fslpI MsgDummyIdent (mr MsgDummyIdentPlaceholder) & noAutocomplete & addName PostLoginDummy) Nothing
|
||||||
where
|
where
|
||||||
userList = fmap mkOptionList . runDB $ withReaderT projectBackend (map toOption <$> selectList [] [Asc UserIdent] :: ReaderT SqlBackend _ [Option UserIdent])
|
userList = fmap mkOptionList . runDB $ withReaderT projectBackend (map toOption <$> selectList [] [Asc UserIdent] :: ReaderT SqlBackend _ [Option UserIdent])
|
||||||
toOption (Entity _ User{..}) = Option userDisplayName userIdent (CI.original userIdent)
|
toOption (Entity _ User{..}) = Option userDisplayName userIdent (CI.original userIdent)
|
||||||
|
|||||||
@ -56,6 +56,7 @@ data GlobalPostParam = PostFormIdentifier
|
|||||||
| PostMassInputShape
|
| PostMassInputShape
|
||||||
| PostBearer
|
| PostBearer
|
||||||
| PostDBCsvImportAction
|
| PostDBCsvImportAction
|
||||||
|
| PostLoginDummy
|
||||||
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
|
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
|
||||||
|
|
||||||
instance Universe GlobalPostParam
|
instance Universe GlobalPostParam
|
||||||
|
|||||||
@ -61,6 +61,9 @@ import Data.Typeable
|
|||||||
|
|
||||||
import Handler.Utils (runAppLoggingT)
|
import Handler.Utils (runAppLoggingT)
|
||||||
|
|
||||||
|
import Web.PathPieces (toPathPiece)
|
||||||
|
import Utils.Parameters (GlobalPostParam(PostLoginDummy))
|
||||||
|
|
||||||
|
|
||||||
runDB :: SqlPersistM a -> YesodExample UniWorX a
|
runDB :: SqlPersistM a -> YesodExample UniWorX a
|
||||||
runDB query = do
|
runDB query = do
|
||||||
@ -108,7 +111,7 @@ authenticateAs (Entity _ User{..}) = do
|
|||||||
request $ do
|
request $ do
|
||||||
setMethod "POST"
|
setMethod "POST"
|
||||||
addToken_ "#login--dummy"
|
addToken_ "#login--dummy"
|
||||||
byLabelExact "Identifikation" $ CI.original userIdent
|
addPostParam (toPathPiece PostLoginDummy) $ CI.original userIdent
|
||||||
setUrl $ AuthR $ PluginR "dummy" []
|
setUrl $ AuthR $ PluginR "dummy" []
|
||||||
|
|
||||||
-- | Create a user. The dummy email entry helps to confirm that foreign-key
|
-- | Create a user. The dummy email entry helps to confirm that foreign-key
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user