Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/spec/dummy/log/
/spec/dummy/tmp/
/Gemfile.lock
*.gemfile.lock
/*.sqlite3
/spec/dummy/db/development.sqlite3
/spec/dummy/db/test.sqlite3
1 change: 0 additions & 1 deletion .rspec
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
--format documentation
--color
--require spec_helper
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Rails:
Enabled: true

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.3
DisplayCopNames: true
Exclude:
- bin/**/*
Expand Down
26 changes: 24 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
---
sudo: false
language: ruby
sudo: false
cache: bundler
before_install: gem install bundler -v 1.17
before_script: RAILS_ENV=test bundle exec rake db:create db:schema:load

rvm:
- 2.2.10
- 2.3.8
- 2.4.6
- 2.5.5
- 2.6.3
before_install: gem install bundler -v 2.0.2

gemfile:
- gemfiles/rails4.2_graphql1.8.gemfile
- gemfiles/rails5.0_graphql1.8.gemfile
- gemfiles/rails5.0_graphql1.9.gemfile
- gemfiles/rails5.1_graphql1.8.gemfile
- gemfiles/rails5.1_graphql1.9.gemfile
- gemfiles/rails5.2_graphql1.8.gemfile
- gemfiles/rails5.2_graphql1.9.gemfile

matrix:
include:
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
rvm: 2.5.5
- gemfile: gemfiles/rails_edge_graphql_edge.gemfile
rvm: 2.6.3
49 changes: 49 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
appraise 'rails4.2-graphql1.8' do
gem 'bundler', '~> 1.17'
gem 'rails', github: 'rails/rails', branch: '4-2-stable'
gem 'graphql', '~> 1.8.0'
end

appraise 'rails5.0-graphql1.8' do
gem 'rails', github: 'rails/rails', branch: '5-0-stable'
gem 'graphql', '~> 1.8.0'
gem 'devise_token_auth', '0.1.37'
gem 'devise', '>= 4.0'
end

appraise 'rails5.0-graphql1.9' do
gem 'rails', github: 'rails/rails', branch: '5-0-stable'
gem 'graphql', '~> 1.9.0'
end

appraise 'rails5.1-graphql1.8' do
gem 'rails', github: 'rails/rails', branch: '5-1-stable'
gem 'graphql', '~> 1.8.0'
gem 'devise_token_auth', '0.1.42'
gem 'devise', '>= 4.3'
end

appraise 'rails5.1-graphql1.9' do
gem 'rails', github: 'rails/rails', branch: '5-1-stable'
gem 'graphql', '~> 1.9.0'
end

appraise 'rails5.2-graphql1.8' do
gem 'rails', github: 'rails/rails', branch: '5-2-stable'
gem 'graphql', '~> 1.8.0'
gem 'devise_token_auth', '0.1.43'
gem 'devise', '>= 4.4.2'
end

appraise 'rails5.2-graphql1.9' do
gem 'rails', github: 'rails/rails', branch: '5-2-stable'
gem 'graphql', '~> 1.9.0'
end

appraise 'rails_edge-graphql_edge' do
gem 'sqlite3', '~> 1.4'
gem 'devise_token_auth', github: 'lynndylanhurley/devise_token_auth', branch: 'master'
gem 'devise', '>= 4.7'
gem 'rails', github: 'rails/rails', branch: 'master'
gem 'graphql', github: 'rmosolgo/graphql-ruby', branch: 'master'
end
2 changes: 2 additions & 0 deletions gemfiles/.bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
BUNDLE_RETRY: "1"
10 changes: 10 additions & 0 deletions gemfiles/rails4.2_graphql1.8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "bundler", "~> 1.17"
gem "rails", github: "rails/rails", branch: "4-2-stable"
gem "graphql", "~> 1.8.0"

gemspec path: "../"
11 changes: 11 additions & 0 deletions gemfiles/rails5.0_graphql1.8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "rails", github: "rails/rails", branch: "5-0-stable"
gem "graphql", "~> 1.8.0"
gem "devise_token_auth", "0.1.37"
gem "devise", ">= 4.0"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails5.0_graphql1.9.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "rails", github: "rails/rails", branch: "5-0-stable"
gem "graphql", "~> 1.9.0"

gemspec path: "../"
11 changes: 11 additions & 0 deletions gemfiles/rails5.1_graphql1.8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "rails", github: "rails/rails", branch: "5-1-stable"
gem "graphql", "~> 1.8.0"
gem "devise_token_auth", "0.1.42"
gem "devise", ">= 4.3"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails5.1_graphql1.9.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "rails", github: "rails/rails", branch: "5-1-stable"
gem "graphql", "~> 1.9.0"

gemspec path: "../"
11 changes: 11 additions & 0 deletions gemfiles/rails5.2_graphql1.8.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "rails", github: "rails/rails", branch: "5-2-stable"
gem "graphql", "~> 1.8.0"
gem "devise_token_auth", "0.1.43"
gem "devise", ">= 4.4.2"

gemspec path: "../"
9 changes: 9 additions & 0 deletions gemfiles/rails5.2_graphql1.9.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "rails", github: "rails/rails", branch: "5-2-stable"
gem "graphql", "~> 1.9.0"

gemspec path: "../"
12 changes: 12 additions & 0 deletions gemfiles/rails_edge_graphql_edge.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "listen"
gem "sqlite3", "~> 1.4"
gem "devise_token_auth", github: "lynndylanhurley/devise_token_auth", branch: "master"
gem "devise", ">= 4.7"
gem "rails", github: "rails/rails", branch: "master"
gem "graphql", github: "rmosolgo/graphql-ruby", branch: "master"

gemspec path: "../"
12 changes: 7 additions & 5 deletions graphql_devise.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']
spec.test_files = Dir['spec/**/*']

spec.add_dependency 'devise_token_auth'
spec.add_dependency 'graphql'
spec.add_dependency 'rails', '~> 5.0'
spec.required_ruby_version = '>= 2.2.0'

spec.add_development_dependency 'bundler', '~> 2.0'
spec.add_dependency 'devise_token_auth', '>= 0.1.37'
spec.add_dependency 'graphql', '> 1.8'
spec.add_dependency 'rails', '> 4.0'

spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'factory_bot'
spec.add_development_dependency 'faker'
spec.add_development_dependency 'pry'
Expand All @@ -36,5 +38,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop'
spec.add_development_dependency 'rubocop-performance'
spec.add_development_dependency 'rubocop-rspec'
spec.add_development_dependency 'sqlite3'
spec.add_development_dependency 'sqlite3', '~> 1.3.6'
end
2 changes: 1 addition & 1 deletion spec/dummy/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class ApplicationController < ActionController::API
class ApplicationController < ActionController::Base
end
8 changes: 6 additions & 2 deletions spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
module Dummy
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.2
# config.load_defaults 5.2

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
Expand All @@ -24,6 +24,10 @@ class Application < Rails::Application
# Only loads a smaller set of middleware suitable for API only apps.
# Middleware like session, flash, cookies can be added back manually.
# Skip views, helpers and assets when generating a new resource.
config.api_only = true
# config.api_only = true

if Rails::VERSION::MAJOR >= 5 && Rails::VERSION::MINOR > 1
config.active_record.sqlite3.represent_boolean_as_integer = true
end
end
end
30 changes: 14 additions & 16 deletions spec/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
# Do not eager load code on boot.
config.eager_load = false

# Show full error reports.
config.consider_all_requests_local = true

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
Expand All @@ -27,23 +24,24 @@
config.cache_store = :null_store
end

# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false

config.action_mailer.perform_caching = false

# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false

# Highlight code that triggered database queries in logs.
config.active_record.verbose_query_logs = true
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false

# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
config.action_mailer.default_url_options = { host: 'localhost' }

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
Expand Down
2 changes: 0 additions & 2 deletions spec/dummy/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"

config.action_mailer.perform_caching = false

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
Expand Down
13 changes: 7 additions & 6 deletions spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
config.eager_load = false

# Configure public file server for tests with Cache-Control for performance.
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{1.hour.to_i}"
}
if Rails::VERSION::MAJOR >= 5
config.public_file_server.enabled = true
config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }
else
config.serve_static_files = true
config.static_cache_control = 'public, max-age=3600'
end

# Show full error reports and disable caching.
config.consider_all_requests_local = true
Expand All @@ -28,8 +31,6 @@
# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false

config.action_mailer.perform_caching = false

# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# confirmation, reset password and unlock tokens in the database.
# Devise will use the `secret_key_base` as its `secret_key`
# by default. You can change it below and use your own secret key.
# config.secret_key = '981f041712ce247008f46fec55e5d3e7fea904bd1601412a5810c74af3f1d9c33399bc34405b85a78dac04c9fb017270e691305b3ddb073f93578df124538e89'
config.secret_key = 'a467ba2b5402838f5ffeb01167cac97af056f041cde2bba89b2ec4b29631ba2911b959ca60fa167303e8794bf58b1ea91323c78875eaa33308a44ccb4deef5e1'

# ==> Controller configuration
# Configure the parent class to the devise controllers.
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/initializers/devise_token_auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Limiting the token_cost to just 4 in testing will increase the performance of
# your test suite dramatically. The possible cost value is within range from 4
# to 31. It is recommended to not use a value more than 10 in other environments.
config.token_cost = Rails.env.test? ? 4 : 10
# config.token_cost = Rails.env.test? ? 4 : 10

# Sets the max number of concurrent devices per user, which is 10 by default.
# After this limit is reached, the oldest tokens will be removed.
Expand Down
17 changes: 17 additions & 0 deletions spec/dummy/config/secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
common_env: &common
secret_key_base: 'secret_key_here'

development:
<<: *common

test:
<<: *common

dev:
<<: *common

staging:
<<: *common

production:
<<: *common
4 changes: 2 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

abort('The Rails environment is running in production mode!') if Rails.env.production?

require 'spec_helper'
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
require 'spec_helper'
require 'factory_bot'
require 'faker'

Expand All @@ -25,7 +25,7 @@
exit 1
end
RSpec.configure do |config|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.fixture_path = "#{ENGINE_ROOT}/spec/fixtures"

config.use_transactional_fixtures = true

Expand Down
Loading