Skip to content
Open
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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: [master, main]
pull_request:
branches: [master, main]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
ruby: ["3.3", "3.4"]
devise: ["4", "5"]

name: Ruby ${{ matrix.ruby }} / Devise ${{ matrix.devise }}

steps:
- uses: actions/checkout@v4

- name: Set up Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
env:
DEVISE_VERSION: ${{ matrix.devise }}

- name: Set up database
run: |
cd spec/dummy && bundle exec rake db:schema:load
env:
RAILS_ENV: test
DEVISE_VERSION: ${{ matrix.devise }}

- name: Run RSpec
run: bundle exec rspec
env:
RAILS_ENV: test
DEVISE_VERSION: ${{ matrix.devise }}

- name: Run Cucumber
run: bundle exec cucumber
env:
RAILS_ENV: test
DEVISE_VERSION: ${{ matrix.devise }}
6 changes: 6 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in devise_masquerade.gemspec
gemspec

if ENV["DEVISE_VERSION"] == "5"
gem "devise", "~> 5.0"
elsif ENV["DEVISE_VERSION"] == "4"
gem "devise", "~> 4.9"
end

group :test do
gem 'activerecord', '>= 8.0.3'

Expand Down
5 changes: 1 addition & 4 deletions spec/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
config.action_dispatch.show_exceptions = :none

# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_10_22_100000) do
ActiveRecord::Schema[7.2].define(version: 2019_10_22_100000) do

create_table "admin_users", force: :cascade do |t|
t.string "email", default: "", null: false
Expand Down
2 changes: 1 addition & 1 deletion spec/support/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def current_user

def admin_logged_in
@admin_user ||= create(:admin_user)
sign_in(:admin, @admin_user)
sign_in(@admin_user, scope: :admin)
end

def current_admin_user
Expand Down