This repository was archived by the owner on Jun 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Feature: Save current newsfeed filters to usersettings
8
8
| email | password | isVerified |
9
9
| user @example .com | 1234 | true |
10
10
11
- Scenario : Save user's language
11
+ Scenario : Save your language
12
12
Given you are authenticated
13
13
When you create your user settings via POST request to "/usersettings" with:
14
14
"""
@@ -17,3 +17,21 @@ Feature: Save current newsfeed filters to usersettings
17
17
}
18
18
"""
19
19
Then your language "de" is stored in your user settings
20
+
21
+ Scenario : Save your filter settings
22
+ Given you are authenticated
23
+ When you create your user settings via POST request to "/usersettings" with:
24
+ """
25
+ {
26
+ "contentLanguages" : [ "en" ],
27
+ "uiLanguage" : "en",
28
+ "filter": {
29
+ "categoryIds": [
30
+ "5b310ab8b801653c1eb6c426",
31
+ "5b310ab8b801653c1eb6c427",
32
+ "5b310ab8b801653c1eb6c428"
33
+ ]
34
+ }
35
+ }
36
+ """
37
+ Then these category ids are stored in your user settings
Original file line number Diff line number Diff line change @@ -79,6 +79,18 @@ Then('a new post is created', function () {
79
79
} ) ;
80
80
81
81
82
+ Then ( 'these category ids are stored in your user settings' , function ( ) {
83
+ return this . app . service ( 'usersettings' ) . find ( { userId : currentUser . _id . toString ( ) } ) . then ( ( settings ) => {
84
+ expect ( settings . total ) . to . eq ( 1 ) ;
85
+ let usersettings = settings . data [ 0 ] ;
86
+ expect ( usersettings . uiLanguage ) . to . eq ( 'en' ) ;
87
+ expect ( usersettings . filter . categoryIds ) . to . be . an ( 'array' )
88
+ . that . does . include ( '5b310ab8b801653c1eb6c426' )
89
+ . that . does . include ( '5b310ab8b801653c1eb6c427' )
90
+ . that . does . include ( '5b310ab8b801653c1eb6c428' ) ;
91
+ } ) ;
92
+ } ) ;
93
+
82
94
Then ( 'your language {string} is stored in your user settings' , function ( lang ) {
83
95
return this . app . service ( 'usersettings' ) . find ( { userId : currentUser . _id . toString ( ) } ) . then ( ( settings ) => {
84
96
expect ( settings . total ) . to . eq ( 1 ) ;
You can’t perform that action at this time.
0 commit comments