|
34 | 34 | it 'raises an invalid resource_name error' do
|
35 | 35 | expect { post_request('/api/v1/failing') }.to raise_error(
|
36 | 36 | GraphqlDevise::Error,
|
37 |
| - 'Invalid resource_name `fail` provided to `graphql_context`. Possible values are: [:user, :admin, :guest, :users_customer].' |
| 37 | + 'Invalid resource_name `fail` provided to `graphql_context`. Possible values are: [:user, :admin, :guest, :users_customer, :schema_user].' |
38 | 38 | )
|
39 | 39 | end
|
40 | 40 | end
|
|
55 | 55 | context 'when user is authenticated' do
|
56 | 56 | let(:headers) { user.create_new_auth_token }
|
57 | 57 |
|
58 |
| - it 'allow to perform the query' do |
| 58 | + it 'allows to perform the query' do |
59 | 59 | expect(json_response[:data][:privateField]).to eq('Field will always require authentication')
|
60 | 60 | end
|
| 61 | + |
| 62 | + context 'when using a SchemaUser' do |
| 63 | + let(:headers) { create(:schema_user, :confirmed).create_new_auth_token } |
| 64 | + |
| 65 | + it 'allows to perform the query' do |
| 66 | + expect(json_response[:data][:privateField]).to eq('Field will always require authentication') |
| 67 | + end |
| 68 | + end |
61 | 69 | end
|
62 | 70 |
|
63 | 71 | context 'when user is not authenticated' do
|
|
75 | 83 | context 'when user is authenticated' do
|
76 | 84 | let(:headers) { user.create_new_auth_token }
|
77 | 85 |
|
78 |
| - it 'allow to perform the query' do |
| 86 | + it 'allows to perform the query' do |
79 | 87 | expect(json_response[:data][:privateField]).to eq('Field will always require authentication')
|
80 | 88 | end
|
81 | 89 | end
|
|
105 | 113 | context 'when user is authenticated' do
|
106 | 114 | let(:headers) { user.create_new_auth_token }
|
107 | 115 |
|
108 |
| - it 'allow to perform the query' do |
| 116 | + it 'allows to perform the query' do |
109 | 117 | expect(json_response[:data][:dummyMutation]).to eq('Necessary so GraphQL gem does not complain about empty mutation type')
|
110 | 118 | end
|
111 | 119 | end
|
|
125 | 133 | context 'when user is authenticated' do
|
126 | 134 | let(:headers) { user.create_new_auth_token }
|
127 | 135 |
|
128 |
| - it 'allow to perform the query' do |
| 136 | + it 'allows to perform the query' do |
129 | 137 | expect(json_response[:data][:dummyMutation]).to eq('Necessary so GraphQL gem does not complain about empty mutation type')
|
130 | 138 | end
|
131 | 139 | end
|
|
160 | 168 | context 'when user is authenticated' do
|
161 | 169 | let(:headers) { user.create_new_auth_token }
|
162 | 170 |
|
163 |
| - it 'allow to perform the query' do |
| 171 | + it 'allows to perform the query' do |
164 | 172 | expect(json_response[:data][:user]).to match(
|
165 | 173 | email: user.email,
|
166 | 174 | id: user.id
|
|
183 | 191 | context 'when user is authenticated' do
|
184 | 192 | let(:headers) { user.create_new_auth_token }
|
185 | 193 |
|
186 |
| - it 'allow to perform the query' do |
| 194 | + it 'allows to perform the query' do |
187 | 195 | expect(json_response[:data][:user]).to match(
|
188 | 196 | email: user.email,
|
189 | 197 | id: user.id
|
|
193 | 201 |
|
194 | 202 | context 'when user is not authenticated' do
|
195 | 203 | # Interpreter schema fields are public unless specified otherwise (plugin setting)
|
196 |
| - it 'allow to perform the query' do |
| 204 | + it 'allows to perform the query' do |
197 | 205 | expect(json_response[:data][:user]).to match(
|
198 | 206 | email: user.email,
|
199 | 207 | id: user.id
|
|
0 commit comments