From f10be7a301e0c3d6ea2244fd76b09b0fe8423fcc Mon Sep 17 00:00:00 2001 From: Jorge T Date: Mon, 10 Apr 2023 11:29:34 +0200 Subject: [PATCH 1/3] Updating test configuration to run with rails7 and mongoid7 --- .github/workflows/test.yml | 18 ++++++++++++------ gemfiles/rails_7_0_mongoid_7.gemfile | 11 ++++++----- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5286d5ef..111d9e101 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,20 +46,26 @@ jobs: - ruby: 2.7 gemfile: gemfiles/rails_6_0_mongoid_7.gemfile devise-token-auth-orm: mongoid + - ruby: 2.7 + gemfile: gemfiles/rails_7_0_mongoid_7.gemfile + devise-token-auth-orm: mongoid - ruby: 2.7 gemfile: gemfiles/rails_7_0.gemfile - ruby: '3.0' gemfile: gemfiles/rails_7_0.gemfile + - ruby: '3.0' + gemfile: gemfiles/rails_7_0_mongoid_7.gemfile + devise-token-auth-orm: mongoid - ruby: 3.1 gemfile: gemfiles/rails_7_0.gemfile + - ruby: 3.1 + gemfile: gemfiles/rails_7_0_mongoid_7.gemfile + devise-token-auth-orm: mongoid - ruby: 3.2 gemfile: gemfiles/rails_7_0.gemfile - # Waiting for mongoid to support Rails 7.0 - # - ruby: '3.0' - # gemfile: gemfiles/rails_7_0.gemfile - # - ruby: '3.0' - # gemfile: gemfiles/rails_7_0_mongoid_7.gemfile - # devise-token-auth-orm: mongoid + - ruby: 3.2 + gemfile: gemfiles/rails_7_0_mongoid_7.gemfile + devise-token-auth-orm: mongoid exclude: - ruby: 2.4 gemfile: gemfiles/rails_6_0.gemfile diff --git a/gemfiles/rails_7_0_mongoid_7.gemfile b/gemfiles/rails_7_0_mongoid_7.gemfile index 32561e4e7..c6653099f 100644 --- a/gemfiles/rails_7_0_mongoid_7.gemfile +++ b/gemfiles/rails_7_0_mongoid_7.gemfile @@ -4,27 +4,28 @@ source "https://rubygems.org" gem "omniauth", "~> 2.0" gem "rails", "~> 7.0" +gem "omniauth-rails_csrf_protection" gem "mongoid", "~> 7.0" gem "mongoid-locker", "~> 1.0" group :development, :test do gem "attr_encrypted" - gem "figaro" + gem "figaro", "~> 1.2" gem "omniauth-facebook" gem "omniauth-github" gem "omniauth-google-oauth2" gem "omniauth-apple" gem "rack-cors" - gem "thor" + gem "thor", "~> 1.2" gem "database_cleaner-mongoid" gem "factory_bot_rails" - gem "faker" + gem "faker", "~> 2.16" gem "fuzz_ball" gem "guard" gem "guard-minitest" gem "minitest" gem "minitest-focus" - gem "minitest-rails" + gem "minitest-rails", "~> 7" gem "minitest-reporters" gem "mocha", ">= 1.5" gem "pry" @@ -35,7 +36,7 @@ end group :test do gem "rails-controller-testing" - gem "simplecov", "~> 0.10", "< 0.18", require: false + gem "simplecov", require: false end group :development do From 9ae879a7c798220c6cc7337a5827b21460b346ae Mon Sep 17 00:00:00 2001 From: Jorge T Date: Tue, 11 Apr 2023 09:08:25 +0200 Subject: [PATCH 2/3] Skipping active_record configuration for mongoid in test environment --- test/dummy/config/environments/test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index 522d49a97..0a31ff05c 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -23,7 +23,7 @@ (config.public_file_server.headers = { 'Cache-Control' => 'public, max-age=3600' }) : (config.static_cache_control = 'public, max-age=3600') - if Rails::VERSION::MAJOR > 6 + if Rails::VERSION::MAJOR > 6 && ENV['DEVISE_TOKEN_AUTH_ORM'] != 'mongoid' config.active_record.legacy_connection_handling = false end From 5ce8263ff7a51ce3d866939163cc749d178964cc Mon Sep 17 00:00:00 2001 From: Jorge T Date: Fri, 14 Apr 2023 08:54:41 +0200 Subject: [PATCH 3/3] Updating README status build badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 59800f247..4b32164c8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Devise Token Auth [![Gem Version](https://badge.fury.io/rb/devise_token_auth.svg)](http://badge.fury.io/rb/devise_token_auth) -[![Build Status](https://travis-ci.org/lynndylanhurley/devise_token_auth.svg?branch=master)](https://travis-ci.org/lynndylanhurley/devise_token_auth) +[![Build Status](https://github.com/lynndylanhurley/devise_token_auth/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/lynndylanhurley/devise_token_auth/actions/workflows/test.yml) [![Code Climate](https://codeclimate.com/github/lynndylanhurley/devise_token_auth/badges/gpa.svg)](https://codeclimate.com/github/lynndylanhurley/devise_token_auth) [![Test Coverage](https://codeclimate.com/github/lynndylanhurley/devise_token_auth/badges/coverage.svg)](https://codeclimate.com/github/lynndylanhurley/devise_token_auth/coverage) [![Downloads](https://img.shields.io/gem/dt/devise_token_auth.svg)](https://rubygems.org/gems/devise_token_auth)