Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
parndt committed Dec 12, 2023
2 parents b7af987 + a88792c commit f5b1630
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 26 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches:
- master
pull_request:

jobs:
test:
strategy:
matrix:
database: [ mysql, postgresql ]
ruby: [ 2.7, 2.6 ]
fail-fast: false
max-parallel: 20
runs-on: ubuntu-latest

env:
CI: true
DB: ${{ matrix.database }}
MYSQL_PASSWORD: root
PGHOST: localhost
PGPASSWORD: runner
PGUSER: runner
RAILS_ENV: test
RETRY_COUNT: 3

name: ${{ matrix.ruby }} ${{ matrix.database }}
steps:
- run: sudo apt-get update && sudo apt-get install libsqlite3-dev -y
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: ${{ matrix.ruby }}

- name: "Set up MySQL using VM's server"
if: ${{ env.DB == 'mysql' }}
run: |
sudo apt-get install libmysqlclient-dev -y
sudo systemctl start mysql.service
- name: "Set up PostgreSQL using VM's server"
if: ${{ env.DB == 'postgresql' }}
run: |
sudo apt-get install libpq-dev -y
sudo systemctl start postgresql.service
sudo -u postgres psql -c "CREATE USER runner WITH SUPERUSER PASSWORD 'runner'"
- run: bin/rake refinery:testing:dummy_app
- run: bin/rspec spec
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ git "https://github.com/refinery/refinerycms", branch: "master" do
end

# Database Configuration
unless ENV["TRAVIS"]
unless ENV["CI"]
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
gem "sqlite3", :platform => :ruby
end

if !ENV["TRAVIS"] || ENV["DB"] == "mysql"
if !ENV["CI"] || ENV["DB"] == "mysql"
gem "activerecord-jdbcmysql-adapter", :platform => :jruby
gem "jdbc-mysql", "= 5.1.13", :platform => :jruby
gem "mysql2", :platform => :ruby
end

if !ENV["TRAVIS"] || ENV["DB"] == "postgresql"
if !ENV["CI"] || ENV["DB"] == "postgresql"
gem "activerecord-jdbcpostgresql-adapter", :platform => :jruby
gem "pg", :platform => :ruby
end
Expand All @@ -36,12 +36,12 @@ group :assets do
gem "uglifier"
end

group :development do
gem 'listen'
end
gem 'listen'

group :test do
gem "database_cleaner-active_record"
gem "launchy"
gem "pry"
end

# Load local gems according to Refinery developer preference.
Expand Down
2 changes: 1 addition & 1 deletion refinerycms-authentication-devise.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.add_dependency 'refinerycms-core', ['>= 3.0.0', '< 5.0']
s.add_dependency 'actionmailer', '>= 5.0.0'
s.add_dependency 'devise', ['~> 4.0', '>= 4.3.0']
s.add_dependency 'friendly_id', '~> 5.2.1'
s.add_dependency 'friendly_id', '~> 5.2'

s.required_ruby_version = '>= 2.2.2'
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
describe "#new" do
it "renders the new template" do
get :new
expect(response).to be_success

expect(response).to be_successful
expect(response).to render_template("refinery/authentication/devise/admin/users/new")
end

Expand All @@ -45,7 +46,7 @@
expect(user).to receive(:save).once{ false }
expect(Refinery::Authentication::Devise::User).to receive(:new).once.with(instance_of(ActionController::Parameters)){ user }
post :create, params: { user: { username: 'bobby' } }
expect(response).to be_success
expect(response).to be_successful
expect(response).to render_template("refinery/authentication/devise/admin/users/new")
end
end
Expand All @@ -55,7 +56,7 @@

it "renders the edit template" do
get :edit, params: { id: logged_in_user.id }
expect(response).to be_success
expect(response).to be_successful
expect(response).to render_template("refinery/authentication/devise/admin/users/edit")
end

Expand Down
11 changes: 11 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@
rails actionpack railties capybara activesupport rack warden rspec actionview
activerecord dragonfly benchmark
).map { |noisy| /#{noisy}/ }

config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end

config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
end

# Requires supporting files with custom matchers and macros, etc,
Expand Down

0 comments on commit f5b1630

Please sign in to comment.