@@ -20,19 +20,19 @@ def perform(args = {})
2020 }
2121 }
2222 GRAPHQL
23- post '/graph' , params : { query : query , variables : args }
23+ post '/graph' , params : { query : query , variables : args } , headers : { 'HTTP_AUTHORIZATION' => "Bearer: #{ @token } " }
2424 JSON . parse ( @response . body )
2525 end
2626
2727 test 'should not update without valid token' do
2828 parameters = {
2929 input : {
3030 arguments : {
31- email : 'janedoe@localhost.com' ,
32- token : ''
31+ email : 'janedoe@localhost.com'
3332 }
3433 }
3534 }
35+ @token = ''
3636 result = perform ( parameters )
3737
3838 assert_equal ( 'Must be logged in to access requested resource' , result [ 'errors' ] [ 0 ] [ 'message' ] )
@@ -45,8 +45,7 @@ def perform(args = {})
4545 firstName : 'Jonathan' ,
4646 lastName : 'D.' ,
4747 email : 'jonathandoe@localhost.com' ,
48- password : '!a1B2c3D4e5F6g!' ,
49- token : @token
48+ password : '!a1B2c3D4e5F6g!'
5049 }
5150 }
5251 }
@@ -62,8 +61,7 @@ def perform(args = {})
6261 parameters = {
6362 input : {
6463 arguments : {
65- firstName : '' ,
66- token : @token
64+ firstName : ''
6765 }
6866 }
6967 }
@@ -76,8 +74,7 @@ def perform(args = {})
7674 parameters = {
7775 input : {
7876 arguments : {
79- lastName : '' ,
80- token : @token
77+ lastName : ''
8178 }
8279 }
8380 }
@@ -90,8 +87,7 @@ def perform(args = {})
9087 parameters = {
9188 input : {
9289 arguments : {
93- email : '' ,
94- token : @token
90+ email : ''
9591 }
9692 }
9793 }
@@ -104,8 +100,7 @@ def perform(args = {})
104100 parameters = {
105101 input : {
106102 arguments : {
107- email : 'janedoe@localhost.com' ,
108- token : @token
103+ email : 'janedoe@localhost.com'
109104 }
110105 }
111106 }
0 commit comments