From 385d312535359049171a243e35a4bed3a364453f Mon Sep 17 00:00:00 2001 From: Ben Pickles Date: Thu, 4 Sep 2025 22:06:51 +0100 Subject: [PATCH] Fix ActiveStorage integration test on CI --- .github/workflows/main.yml | 1 + Rakefile | 4 ++++ example-app/db/seeds.rb | 2 +- spec/parklife/integration_spec.rb | 2 -- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 533d1f3..2142914 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,6 +65,7 @@ jobs: with: bundler-cache: true ruby-version: ${{ matrix.ruby }} + - run: bundle exec rake db:setup - run: bundle exec rspec rubocop: diff --git a/Rakefile b/Rakefile index 28dc223..c544b05 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,10 @@ require 'bundler/gem_tasks' require 'rspec/core/rake_task' +# Enable `db:setup` and friends. +require_relative 'example-app/config/application' +Rails.application.load_tasks + RSpec::Core::RakeTask.new(:spec) require 'rubocop/rake_task' diff --git a/example-app/db/seeds.rb b/example-app/db/seeds.rb index 538328f..133b9b4 100644 --- a/example-app/db/seeds.rb +++ b/example-app/db/seeds.rb @@ -13,5 +13,5 @@ post.hero.attach( filename: 'plasma.jpg', io: File.open(plasma_path), - ) if i.odd? + ) if i.even? end diff --git a/spec/parklife/integration_spec.rb b/spec/parklife/integration_spec.rb index 8156304..ad49a4f 100644 --- a/spec/parklife/integration_spec.rb +++ b/spec/parklife/integration_spec.rb @@ -58,8 +58,6 @@ def parklife(cmd, env = {}) end it 'builds successfully and includes encountered ActiveStorage blobs' do - skip('FIXME: get me working on CI') if ENV['CI'] - env = { 'RAILS_ENV' => 'development' } stdout, status = parklife('build', env)