-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
357aab6
commit 6b59c4f
Showing
8 changed files
with
127 additions
and
24 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Expose /providers/assets via nginz |
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
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
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,26 @@ | ||
module Test.Provider where | ||
|
||
import API.Brig | ||
-- import API.Cargohold (uploadProviderAsset) | ||
|
||
import qualified API.Cargohold as Cargohold | ||
import API.Common | ||
import qualified API.Nginz as Nginz | ||
import Data.String.Conversions (cs) | ||
import SetupHelpers | ||
import Testlib.Prelude | ||
|
||
testProviderUploadAsset :: HasCallStack => App () | ||
testProviderUploadAsset = do | ||
email <- randomEmail | ||
alice <- randomUser OwnDomain def | ||
provider <- setupProvider alice def {newProviderEmail = email} | ||
pid <- provider %. "id" & asString | ||
-- test cargohold API | ||
bindResponse (Cargohold.uploadProviderAsset OwnDomain pid "profile pic") $ \resp -> do | ||
resp.status `shouldMatchInt` 201 | ||
pw <- provider %. "password" & asString | ||
cookie <- loginProvider OwnDomain email pw | ||
-- test Nginz API | ||
bindResponse (Nginz.uploadProviderAsset OwnDomain (cs cookie) "another profile pic") $ \resp -> do | ||
resp.status `shouldMatchInt` 201 |
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