diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 937b7993..2e89a950 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ env: jobs: test: name: RSpec - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest services: postgres: image: postgres:11 @@ -29,10 +29,14 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 1 + - uses: nanasess/setup-chromedriver@v2 + with: + chromedriver-version: 119.0.6045.105 + - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ env.RUBY_VERSION }} diff --git a/config/environments/test.rb b/config/environments/test.rb index 1d02385b..32fe8dd7 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -7,7 +7,7 @@ # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true + config.cache_classes = false # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that diff --git a/spec/models/assembly_spec.rb b/spec/models/assembly_spec.rb index 8754cab7..3df738ad 100644 --- a/spec/models/assembly_spec.rb +++ b/spec/models/assembly_spec.rb @@ -22,7 +22,7 @@ module Decidim end it "has no default scope" do - expect(Assembly.default_scope).not_to be_present + expect(Assembly.all.to_sql).not_to include("WHERE") expect(Assembly.scope_types).not_to be_present expect(Assembly.scope_types_mode).not_to be_present end @@ -41,7 +41,7 @@ module Decidim end it "has a default scope" do - expect(Assembly.default_scope).to be_present + expect(Assembly.all.to_sql).to include("WHERE") expect(Assembly.scope_types).to eq([type1.id]) expect(Assembly.scope_types_mode).to eq(:include) end @@ -60,7 +60,7 @@ module Decidim end it "has a default scope" do - expect(Assembly.default_scope).to be_present + expect(Assembly.all.to_sql).to include("WHERE") expect(Assembly.scope_types).to eq([type2.id]) expect(Assembly.scope_types_mode).to eq(:exclude) end diff --git a/spec/models/participatory_process_spec.rb b/spec/models/participatory_process_spec.rb index 4dcb73e8..e08ed5ff 100644 --- a/spec/models/participatory_process_spec.rb +++ b/spec/models/participatory_process_spec.rb @@ -16,7 +16,7 @@ module Decidim end it "has no default scope" do - expect(ParticipatoryProcess.default_scope).not_to be_present + expect(ParticipatoryProcess.all.to_sql).not_to include("WHERE") expect(ParticipatoryProcess.scoped_slug_namespace).not_to be_present expect(ParticipatoryProcess.scoped_slug_prefixes).not_to be_present expect(ParticipatoryProcess.scoped_slug_prefixes_mode).not_to be_present @@ -35,7 +35,7 @@ module Decidim end it "has a default scope" do - expect(ParticipatoryProcess.default_scope).to be_present + expect(ParticipatoryProcess.all.to_sql).to include("WHERE") expect(ParticipatoryProcess.scoped_slug_namespace).to eq(namespace) expect(ParticipatoryProcess.scoped_slug_prefixes).to eq([scoped_slug_prefix]) expect(ParticipatoryProcess.scoped_slug_prefixes_mode).to eq(:include) @@ -54,7 +54,7 @@ module Decidim end it "has a default scope" do - expect(ParticipatoryProcess.default_scope).to be_present + expect(ParticipatoryProcess.all.to_sql).to include("WHERE") expect(ParticipatoryProcess.scoped_slug_namespace).to eq(namespace) expect(ParticipatoryProcess.scoped_slug_prefixes).to eq([scoped_slug_prefix]) expect(ParticipatoryProcess.scoped_slug_prefixes_mode).to eq(:exclude)