graphql_devise 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ RSpec.describe 'Login Requests' do
15
15
  password: "#{password}"
16
16
  ) {
17
17
  user { email name signInCount }
18
+ credentials { accessToken uid tokenType client expiry }
18
19
  }
19
20
  }
20
21
  GRAPHQL
@@ -24,11 +25,18 @@ RSpec.describe 'Login Requests' do
24
25
 
25
26
  context 'when user is able to login' do
26
27
  context 'when credentials are valid' do
27
- it 'return credentials in headers and user information' do
28
+ it 'return credentials in headers/field and user information' do
28
29
  expect(response).to include_auth_headers
29
30
  expect(user.reload.tokens.keys).to include(response.headers['client'])
30
31
  expect(json_response[:data][:userLogin]).to match(
31
- user: { email: user.email, name: user.name, signInCount: 1 }
32
+ user: { email: user.email, name: user.name, signInCount: 1 },
33
+ credentials: {
34
+ accessToken: response.headers['access-token'],
35
+ uid: response.headers['uid'],
36
+ tokenType: response.headers['token-type'],
37
+ client: response.headers['client'],
38
+ expiry: response.headers['expiry'].to_i
39
+ }
32
40
  )
33
41
  expect(json_response[:errors]).to be_nil
34
42
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,15 @@
1
1
  require 'pry'
2
2
  require 'bundler/setup'
3
3
  require 'graphql_devise'
4
+ require 'simplecov'
5
+ require 'coveralls'
6
+
7
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
8
+ SimpleCov.start do
9
+ add_filter 'spec'
10
+ add_filter 'test'
11
+ add_filter 'lib/generators'
12
+ end
4
13
 
5
14
  RSpec.configure do |config|
6
15
  # Enable flags like --only-failures and --next-failure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Celi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-11-27 00:00:00.000000000 Z
12
+ date: 2019-12-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: devise_token_auth
@@ -67,6 +67,20 @@ dependencies:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: coveralls
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
70
84
  - !ruby/object:Gem::Dependency
71
85
  name: factory_bot
72
86
  requirement: !ruby/object:Gem::Requirement
@@ -272,6 +286,7 @@ files:
272
286
  - app/graphql/graphql_devise/resolvers/dummy.rb
273
287
  - app/graphql/graphql_devise/schema.rb
274
288
  - app/graphql/graphql_devise/types/authenticatable_type.rb
289
+ - app/graphql/graphql_devise/types/credential_type.rb
275
290
  - app/graphql/graphql_devise/types/mutation_type.rb
276
291
  - app/graphql/graphql_devise/types/query_type.rb
277
292
  - app/helpers/graphql_devise/application_helper.rb