diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-12 06:09:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-12 06:09:17 +0300 |
commit | 554826c7017ebcb2ce7343c1ea491dc611050b0b (patch) | |
tree | fefb8415b226e2effd9b5763baf0b4304c27d7ca /spec/migrations | |
parent | 88544d284c0a25d45ea51c1817fcab1c7e99afe7 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/cap_designs_filename_length_to_new_limit_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/migrations/cap_designs_filename_length_to_new_limit_spec.rb b/spec/migrations/cap_designs_filename_length_to_new_limit_spec.rb index 523c8864b63..382ce2e1da4 100644 --- a/spec/migrations/cap_designs_filename_length_to_new_limit_spec.rb +++ b/spec/migrations/cap_designs_filename_length_to_new_limit_spec.rb @@ -32,17 +32,19 @@ RSpec.describe CapDesignsFilenameLengthToNewLimit, :migration, schema: 202005281 end it 'correctly sets filenames that are above the limit' do - [ + designs = [ filename_below_limit, filename_at_limit, filename_above_limit - ].each(&method(:create_design)) + ].map(&method(:create_design)) migrate! - expect(designs.find(1).filename).to eq(filename_below_limit) - expect(designs.find(2).filename).to eq(filename_at_limit) - expect(designs.find(3).filename).to eq([described_class::MODIFIED_NAME, 3, described_class::MODIFIED_EXTENSION].join) + designs.each(&:reload) + + expect(designs[0].filename).to eq(filename_below_limit) + expect(designs[1].filename).to eq(filename_at_limit) + expect(designs[2].filename).to eq([described_class::MODIFIED_NAME, designs[2].id, described_class::MODIFIED_EXTENSION].join) end it 'runs after filename limit has been set' do |