diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43f76c7..916597e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} strategy: - fail-fast: true matrix: ruby: [2.3, 2.4, 2.5, 2.6, 2.7, 3.0, jruby, truffleruby] mongoid: [7] @@ -27,9 +26,9 @@ jobs: - ruby: 2.3 mongoid: 3 experimental: false - - ruby: 2.3 - mongoid: 4 - experimental: false + # - ruby: 2.3 + # mongoid: 4 + # experimental: false - ruby: 2.3 mongoid: 5 experimental: false @@ -64,11 +63,15 @@ jobs: - name: bundle install run: bundle install --jobs 4 --retry 3 + env: + MONGOID_VERSION: ${{ matrix.mongoid }} - name: rubocop timeout-minutes: 5 run: bundle exec rubocop continue-on-error: ${{ matrix.experimental }} + env: + MONGOID_VERSION: ${{ matrix.mongoid }} - name: test timeout-minutes: 10 diff --git a/Gemfile b/Gemfile index 5380df4..82bb5ed 100644 --- a/Gemfile +++ b/Gemfile @@ -21,5 +21,5 @@ end group :test do gem 'mongoid-danger', '~> 0.1.0', require: false - gem 'rubocop', '0.58.2' + gem 'rubocop', '0.57.2' end diff --git a/spec/mongoid/slug_spec.rb b/spec/mongoid/slug_spec.rb index dde8197..c4e401e 100644 --- a/spec/mongoid/slug_spec.rb +++ b/spec/mongoid/slug_spec.rb @@ -1134,18 +1134,23 @@ class Person before do Author.create_indexes end + after do Author.remove_indexes end + it 'can be assigned to nil' do expect(Book.slug_max_length).to be nil end + it 'defaults to MONGO_INDEX_KEY_LIMIT_BYTES - 32' do expect(Article.slug_max_length).to eq Mongoid::Slug::MONGO_INDEX_KEY_LIMIT_BYTES - 32 end + it 'is assigned via max_length' do expect(Author.slug_max_length).to eq 256 end + it 'enforces max length of slug' do author1 = Author.create!(last_name: 't' * 1024) expect(author1.slug.length).to eq 256