From ec2f8c3d58e7a396323f794734b0889411605ac9 Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Mon, 27 May 2024 19:29:46 +0930 Subject: [PATCH 1/3] Spec fixes --- Gemfile | 2 ++ spec/feature/basic_search_spec.rb | 5 +---- spec/rails_helper.rb | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 581c451..f70022c 100644 --- a/Gemfile +++ b/Gemfile @@ -4,9 +4,11 @@ source 'https://rubygems.org' gemspec group :test do + gem "rspec-rails" gem "capybara" end +gem "rails", "~> 7.1.0" gem "sqlite3", "~> 1.4" gem "trestle", github: "TrestleAdmin/trestle" diff --git a/spec/feature/basic_search_spec.rb b/spec/feature/basic_search_spec.rb index 1fbfd04..63a6f03 100644 --- a/spec/feature/basic_search_spec.rb +++ b/spec/feature/basic_search_spec.rb @@ -53,9 +53,6 @@ private def search_for(query) visit "/admin/continents" - fill_in "Search", with: query - - form = page.find("#q").ancestor("form") - Capybara::RackTest::Form.new(page.driver, form.native).submit({}) + fill_in "Search", with: "#{query}\n" end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 7fbdc0c..4b7442c 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -17,9 +17,6 @@ end RSpec.configure do |config| - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" - # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. From b0140699385a4a5cdffd352249996d212866011c Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Mon, 27 May 2024 19:31:24 +0930 Subject: [PATCH 2/3] Ignore sqlite3 journal files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 9f68be5..25ea635 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ /spec/dummy/*.sqlite3-journal /spec/dummy/log/*.log /spec/dummy/tmp/* +*.sqlite3-shm +*.sqlite3-wal From b4596e7119a2c39b50898288b2a2782cf4563e2b Mon Sep 17 00:00:00 2001 From: Sam Pohlenz Date: Mon, 27 May 2024 19:33:42 +0930 Subject: [PATCH 3/3] Replace Travis config with Github Actions workflow --- .github/workflows/rspec.yml | 30 +++++++++++++++++++ .travis.yml | 22 -------------- gemfiles/rails-5.2.gemfile | 4 ++- gemfiles/rails-6.0.gemfile | 4 ++- .../{rails-5.1.gemfile => rails-6.1.gemfile} | 10 ++++--- .../{rails-4.2.gemfile => rails-7.0.gemfile} | 10 ++++--- .../{rails-5.0.gemfile => rails-7.1.gemfile} | 10 ++++--- spec/dummy/config/application.rb | 9 +----- 8 files changed, 55 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/rspec.yml delete mode 100644 .travis.yml rename gemfiles/{rails-5.1.gemfile => rails-6.1.gemfile} (52%) rename gemfiles/{rails-4.2.gemfile => rails-7.0.gemfile} (55%) rename gemfiles/{rails-5.0.gemfile => rails-7.1.gemfile} (55%) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml new file mode 100644 index 0000000..c7fa1eb --- /dev/null +++ b/.github/workflows/rspec.yml @@ -0,0 +1,30 @@ +name: RSpec + +on: [push, pull_request] + +jobs: + test: + strategy: + fail-fast: false + matrix: + gemfile: [ rails-5.2, rails-6.0, rails-6.1 ] + ruby: [ '2.7' ] + include: + - gemfile: rails-6.1 + ruby: '3.0' + - gemfile: rails-7.0 + ruby: '2.7' + - gemfile: rails-7.0 + ruby: '3.0' + - gemfile: rails-7.1 + ruby: '3.2' + runs-on: ubuntu-latest + env: + BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - run: bundle exec rake diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d099d8b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: ruby - -cache: bundler - -before_install: - - gem update --system - - gem install bundler - -rvm: - - 2.6.5 - -gemfile: - - gemfiles/rails-5.0.gemfile - - gemfiles/rails-5.1.gemfile - - gemfiles/rails-5.2.gemfile - - gemfiles/rails-6.0.gemfile - -jobs: - include: - gemfile: gemfiles/rails-4.2.gemfile - before_install: - - gem install bundler -v '< 2' diff --git a/gemfiles/rails-5.2.gemfile b/gemfiles/rails-5.2.gemfile index fbf821a..25f1471 100644 --- a/gemfiles/rails-5.2.gemfile +++ b/gemfiles/rails-5.2.gemfile @@ -1,7 +1,9 @@ source 'https://rubygems.org' group :test do - gem "coveralls", require: false + gem "rspec-rails", "~> 5.0" + + gem "coveralls_reborn", require: false gem "capybara" gem "sqlite3", "~> 1.3.13" diff --git a/gemfiles/rails-6.0.gemfile b/gemfiles/rails-6.0.gemfile index 97ff89a..568d81e 100644 --- a/gemfiles/rails-6.0.gemfile +++ b/gemfiles/rails-6.0.gemfile @@ -1,7 +1,9 @@ source 'https://rubygems.org' group :test do - gem "coveralls", require: false + gem "rspec-rails", "~> 5.0" + + gem "coveralls_reborn", require: false gem "capybara" gem "sqlite3", "~> 1.4" diff --git a/gemfiles/rails-5.1.gemfile b/gemfiles/rails-6.1.gemfile similarity index 52% rename from gemfiles/rails-5.1.gemfile rename to gemfiles/rails-6.1.gemfile index 6fb9191..ef26aca 100644 --- a/gemfiles/rails-5.1.gemfile +++ b/gemfiles/rails-6.1.gemfile @@ -1,13 +1,15 @@ source 'https://rubygems.org' group :test do - gem "coveralls", require: false - gem "capybara" + gem "rspec-rails", "~> 5.0" + + gem "coveralls_reborn", require: false - gem "sqlite3", "~> 1.3.13" + gem "capybara" + gem "sqlite3", "~> 1.4" end -gem "rails", "~> 5.1.0" +gem "rails", "~> 6.1.0" gem "trestle", github: "TrestleAdmin/trestle" diff --git a/gemfiles/rails-4.2.gemfile b/gemfiles/rails-7.0.gemfile similarity index 55% rename from gemfiles/rails-4.2.gemfile rename to gemfiles/rails-7.0.gemfile index fcea488..b6d76fc 100644 --- a/gemfiles/rails-4.2.gemfile +++ b/gemfiles/rails-7.0.gemfile @@ -1,13 +1,15 @@ source 'https://rubygems.org' group :test do - gem "coveralls", require: false - gem "capybara" + gem "rspec-rails" + + gem "coveralls_reborn", require: false - gem "sqlite3", "~> 1.3.13" + gem "capybara" + gem "sqlite3", "~> 1.4" end -gem "rails", "~> 4.2.0" +gem "rails", "~> 7.0.0" gem "trestle", github: "TrestleAdmin/trestle" diff --git a/gemfiles/rails-5.0.gemfile b/gemfiles/rails-7.1.gemfile similarity index 55% rename from gemfiles/rails-5.0.gemfile rename to gemfiles/rails-7.1.gemfile index 2924846..74604e2 100644 --- a/gemfiles/rails-5.0.gemfile +++ b/gemfiles/rails-7.1.gemfile @@ -1,13 +1,15 @@ source 'https://rubygems.org' group :test do - gem "coveralls", require: false - gem "capybara" + gem "rspec-rails" + + gem "coveralls_reborn", require: false - gem "sqlite3", "~> 1.3.13" + gem "capybara" + gem "sqlite3", "~> 1.4" end -gem "rails", "~> 5.0.0" +gem "rails", "~> 7.1.0" gem "trestle", github: "TrestleAdmin/trestle" diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb index 8cb614c..56e3219 100644 --- a/spec/dummy/config/application.rb +++ b/spec/dummy/config/application.rb @@ -17,14 +17,7 @@ module Dummy class Application < Rails::Application # Initialize configuration defaults for current Rails version. - case Rails.version.split(".").first(2).join(".") - when '6.0' - config.load_defaults 6.0 - when '5.2' - config.load_defaults 5.2 - when '5.1' - config.load_defaults 5.1 - end + config.load_defaults Rails::VERSION::STRING.to_f # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers