-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
738892c
commit 49cd884
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module Test.UsersSpec where | ||
|
||
import IHP.Prelude | ||
|
||
import IHP.FrameworkConfig | ||
import IHP.Test.Mocking | ||
import IHP.HaskellSupport | ||
import IHP.ModelSupport | ||
import Test.Hspec | ||
import Config | ||
|
||
import Generated.Types | ||
import Web.Routes | ||
import Web.Types | ||
import Web.FrontController | ||
import Network.Wai | ||
import IHP.ControllerPrelude | ||
import IHP.ViewPrelude | ||
import Network.HTTP.Types.Status | ||
|
||
tests :: Spec | ||
tests = aroundAll (withIHPApp WebApplication config) do | ||
describe "Users" do | ||
it "should show users list on users page" $ withContext do | ||
user <- newRecord @User | ||
|> set #email "[email protected]" | ||
|> createRecord | ||
|
||
response <- withUser user do | ||
callAction UsersAction | ||
|
||
response `responseBodyShouldContain` "[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ | |
hlint | ||
jwt | ||
mmark | ||
hspec | ||
]; | ||
}; | ||
|
||
|