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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: bundler
directory: "/"
schedule:
interval: monthly
54 changes: 54 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches:
- master
pull_request:
workflow_dispatch:


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.extension }} ${{ matrix.ruby }} ${{ matrix.database }}
steps:
- run: sudo apt-get update && sudo apt-get install libsqlite3-dev -y
- uses: actions/checkout@v2
- 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
10 changes: 6 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ if !ENV["TRAVIS"] || ENV["DB"] == "mysql"
gem "mysql2", :platform => :ruby
end

if !ENV["TRAVIS"] || ENV["DB"] == "postgresql"
gem "activerecord-jdbcpostgresql-adapter", :platform => :jruby
gem 'pg', '~> 0.21', platform: :ruby
if !ENV['CI'] || ENV['DB'] == 'postgresql'
group :postgres, :postgresql do
gem 'activerecord-jdbcpostgresql-adapter', '>= 1.3.0.rc1', platform: :jruby
gem 'pg', '~> 1.1', platform: :ruby
end
end

gem "jruby-openssl", :platform => :jruby
Expand All @@ -49,4 +51,4 @@ end
# Load local gems according to Refinery developer preference.
if File.exist? local_gemfile = File.expand_path("../.gemfile", __FILE__)
eval File.read(local_gemfile)
end
end
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ if File.exists?(APP_RAKEFILE)
end

require "refinerycms-testing"
Refinery::Testing::Railtie.load_dummy_tasks File.dirname(__FILE__)
Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)

load File.expand_path('../tasks/rspec.rake', __FILE__)

task :default => :spec
task default: :spec
2 changes: 1 addition & 1 deletion app/controllers/refinery/admin/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def new
end

def edit
@setting = ::Refinery::Setting.find(params[:id])
@setting = ::Refinery::Setting.friendly.find(params[:id])

render :layout => false if request.xhr?
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/settings.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :setting, :class => Refinery::Setting do
name "Refinery CMS setting"
name { "Refinery CMS setting" }
end
end
3 changes: 3 additions & 0 deletions spec/support/refinery_login.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def refinery_login
let(:logged_in_user) { Refinery::Core::NilUser.new }
end