Skip to content
Merged
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
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions spec/mongoid/slug_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down