diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-18 13:16:36 +0000 |
commit | 311b0269b4eb9839fa63f80c8d7a58f32b8138a0 (patch) | |
tree | 07e7870bca8aed6d61fdcc810731c50d2c40af47 /spec/models/route_spec.rb | |
parent | 27909cef6c4170ed9205afa7426b8d3de47cbb0c (diff) | |
download | gitlab-ce-311b0269b4eb9839fa63f80c8d7a58f32b8138a0.tar.gz |
Add latest changes from gitlab-org/gitlab@14-5-stable-eev14.5.0-rc42
Diffstat (limited to 'spec/models/route_spec.rb')
-rw-r--r-- | spec/models/route_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/models/route_spec.rb b/spec/models/route_spec.rb index eb81db95cd3..b2fa9c24535 100644 --- a/spec/models/route_spec.rb +++ b/spec/models/route_spec.rb @@ -31,18 +31,18 @@ RSpec.describe Route do context 'after update' do it 'calls #create_redirect_for_old_path' do expect(route).to receive(:create_redirect_for_old_path) - route.update(path: 'foo') + route.update!(path: 'foo') end it 'calls #delete_conflicting_redirects' do expect(route).to receive(:delete_conflicting_redirects) - route.update(path: 'foo') + route.update!(path: 'foo') end end context 'after create' do it 'calls #delete_conflicting_redirects' do - route.destroy + route.destroy! new_route = described_class.new(source: group, path: group.path) expect(new_route).to receive(:delete_conflicting_redirects) new_route.save! @@ -81,7 +81,7 @@ RSpec.describe Route do context 'path update' do context 'when route name is set' do before do - route.update(path: 'bar') + route.update!(path: 'bar') end it 'updates children routes with new path' do @@ -111,7 +111,7 @@ RSpec.describe Route do let!(:conflicting_redirect3) { route.create_redirect('gitlab-org') } it 'deletes the conflicting redirects' do - route.update(path: 'bar') + route.update!(path: 'bar') expect(RedirectRoute.exists?(path: 'bar/test')).to be_falsey expect(RedirectRoute.exists?(path: 'bar/test/foo')).to be_falsey @@ -122,7 +122,7 @@ RSpec.describe Route do context 'name update' do it 'updates children routes with new path' do - route.update(name: 'bar') + route.update!(name: 'bar') expect(described_class.exists?(name: 'bar')).to be_truthy expect(described_class.exists?(name: 'bar / test')).to be_truthy @@ -134,7 +134,7 @@ RSpec.describe Route do # Note: using `update_columns` to skip all validation and callbacks route.update_columns(name: nil) - expect { route.update(name: 'bar') } + expect { route.update!(name: 'bar') } .to change { route.name }.from(nil).to('bar') end end |