graphql_devise 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ FactoryBot.define do
2
+ factory :users_customer, class: 'Users::Customer' do
3
+ name { Faker::FunnyName.two_word_name }
4
+ email { Faker::Internet.unique.email }
5
+ password { Faker::Internet.password }
6
+ end
7
+ end
data/spec/rails_helper.rb CHANGED
@@ -1,7 +1,8 @@
1
+ require 'spec_helper'
2
+
1
3
  ENV['RAILS_ENV'] ||= 'test'
2
4
  ENGINE_ROOT = File.join(File.dirname(__FILE__), '../')
3
5
 
4
- require 'spec_helper'
5
6
  require File.expand_path('dummy/config/environment.rb', __dir__)
6
7
 
7
8
  abort('The Rails environment is running in production mode!') if Rails.env.production?
@@ -146,4 +146,28 @@ RSpec.describe 'Login Requests' do
146
146
  )
147
147
  end
148
148
  end
149
+
150
+ context 'when using the Users::Customer model' do
151
+ let(:customer) { create(:users_customer, password: password) }
152
+ let(:query) do
153
+ <<-GRAPHQL
154
+ mutation {
155
+ usersCustomerLogin(
156
+ email: "#{customer.email}",
157
+ password: "#{password}"
158
+ ) {
159
+ authenticatable { email }
160
+ }
161
+ }
162
+ GRAPHQL
163
+ end
164
+
165
+ before { post_request }
166
+
167
+ it 'works alongside the user mount point' do
168
+ expect(json_response[:data][:usersCustomerLogin]).to include(
169
+ authenticatable: { email: customer.email }
170
+ )
171
+ end
172
+ end
149
173
  end
data/spec/spec_helper.rb CHANGED
@@ -1,19 +1,17 @@
1
- require 'pry'
2
- require 'bundler/setup'
3
- require 'graphql_devise'
4
-
5
1
  if ENV['CI'] && !ENV['SKIP_COVERALLS']
6
2
  require 'simplecov'
7
3
  require 'coveralls'
8
4
 
9
5
  SimpleCov.formatter = Coveralls::SimpleCov::Formatter
10
- SimpleCov.start do
11
- add_filter 'spec'
12
- add_filter 'test'
13
- add_filter 'lib/generators'
6
+ SimpleCov.start 'rails' do
7
+ add_filter ['spec', 'lib/generators']
14
8
  end
15
9
  end
16
10
 
11
+ require 'pry'
12
+ require 'bundler/setup'
13
+ require 'graphql_devise'
14
+
17
15
  RSpec.configure do |config|
18
16
  # Enable flags like --only-failures and --next-failure
19
17
  config.example_status_persistence_file_path = '.rspec_status'
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.10.0
4
+ version: 0.10.1
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: 2020-02-04 00:00:00.000000000 Z
12
+ date: 2020-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: devise_token_auth
@@ -141,16 +141,16 @@ dependencies:
141
141
  name: pry
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ">="
144
+ - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '0'
146
+ version: 0.12.2
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - ">="
151
+ - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '0'
153
+ version: 0.12.2
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: pry-byebug
156
156
  requirement: !ruby/object:Gem::Requirement
@@ -291,8 +291,6 @@ files:
291
291
  - app/graphql/graphql_devise/types/query_type.rb
292
292
  - app/helpers/graphql_devise/application_helper.rb
293
293
  - app/helpers/graphql_devise/mailer_helper.rb
294
- - app/jobs/graphql_devise/application_job.rb
295
- - app/mailers/graphql_devise/application_mailer.rb
296
294
  - app/models/graphql_devise/concerns/model.rb
297
295
  - app/views/.keep
298
296
  - app/views/graphql_devise/mailer/confirmation_instructions.html.erb
@@ -347,6 +345,8 @@ files:
347
345
  - spec/dummy/app/models/application_record.rb
348
346
  - spec/dummy/app/models/guest.rb
349
347
  - spec/dummy/app/models/user.rb
348
+ - spec/dummy/app/models/users.rb
349
+ - spec/dummy/app/models/users/customer.rb
350
350
  - spec/dummy/app/views/layouts/mailer.html.erb
351
351
  - spec/dummy/app/views/layouts/mailer.text.erb
352
352
  - spec/dummy/bin/bundle
@@ -382,6 +382,7 @@ files:
382
382
  - spec/dummy/db/migrate/20190824215150_add_auth_available_to_users.rb
383
383
  - spec/dummy/db/migrate/20190916012505_create_admins.rb
384
384
  - spec/dummy/db/migrate/20191013213045_create_guests.rb
385
+ - spec/dummy/db/migrate/20200321121807_create_users_customers.rb
385
386
  - spec/dummy/db/schema.rb
386
387
  - spec/dummy/db/seeds.rb
387
388
  - spec/dummy/db/test.sqlite3
@@ -392,6 +393,7 @@ files:
392
393
  - spec/factories/admins.rb
393
394
  - spec/factories/guests.rb
394
395
  - spec/factories/users.rb
396
+ - spec/factories/users_customers.rb
395
397
  - spec/generators/graphql_devise/install_generator_spec.rb
396
398
  - spec/graphql_devise_spec.rb
397
399
  - spec/models/user_spec.rb
@@ -445,6 +447,8 @@ test_files:
445
447
  - spec/dummy/app/mailers/application_mailer.rb
446
448
  - spec/dummy/app/models/guest.rb
447
449
  - spec/dummy/app/models/admin.rb
450
+ - spec/dummy/app/models/users/customer.rb
451
+ - spec/dummy/app/models/users.rb
448
452
  - spec/dummy/app/models/application_record.rb
449
453
  - spec/dummy/app/models/user.rb
450
454
  - spec/dummy/app/graphql/types/custom_admin_type.rb
@@ -500,6 +504,7 @@ test_files:
500
504
  - spec/dummy/db/test.sqlite3
501
505
  - spec/dummy/db/migrate/20190916012505_create_admins.rb
502
506
  - spec/dummy/db/migrate/20191013213045_create_guests.rb
507
+ - spec/dummy/db/migrate/20200321121807_create_users_customers.rb
503
508
  - spec/dummy/db/migrate/20190815114303_create_users.rb
504
509
  - spec/dummy/db/migrate/20190824215150_add_auth_available_to_users.rb
505
510
  - spec/dummy/db/development.sqlite3
@@ -529,5 +534,6 @@ test_files:
529
534
  - spec/factories/admins.rb
530
535
  - spec/factories/users.rb
531
536
  - spec/factories/guests.rb
537
+ - spec/factories/users_customers.rb
532
538
  - spec/generators/graphql_devise/install_generator_spec.rb
533
539
  - spec/rails_helper.rb
@@ -1,4 +0,0 @@
1
- module GraphqlDevise
2
- class ApplicationJob < ActiveJob::Base
3
- end
4
- end
@@ -1,6 +0,0 @@
1
- module GraphqlDevise
2
- class ApplicationMailer < ActionMailer::Base
3
- default from: 'from@example.com'
4
- layout 'mailer'
5
- end
6
- end