summaryrefslogtreecommitdiff
path: root/spec/models/chat_name_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 03:08:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 03:08:01 +0000
commit796b00a98a82fcbe082c9343fd4efcccc77478dc (patch)
tree257bcb124f57cb91a8dff75e69649e8a2f91c51d /spec/models/chat_name_spec.rb
parent93dcf45d441bc884b167f4338380c8c888e9b86f (diff)
downloadgitlab-ce-796b00a98a82fcbe082c9343fd4efcccc77478dc.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/chat_name_spec.rb')
-rw-r--r--spec/models/chat_name_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/chat_name_spec.rb b/spec/models/chat_name_spec.rb
index 863c28a86fb..02594b98665 100644
--- a/spec/models/chat_name_spec.rb
+++ b/spec/models/chat_name_spec.rb
@@ -17,6 +17,12 @@ describe ChatName do
it { is_expected.to validate_uniqueness_of(:user_id).scoped_to(:service_id) }
it { is_expected.to validate_uniqueness_of(:chat_id).scoped_to(:service_id, :team_id) }
+ it 'is removed when the project is deleted' do
+ expect { subject.reload.service.project.delete }.to change { ChatName.count }.by(-1)
+
+ expect(ChatName.where(id: subject.id)).not_to exist
+ end
+
describe '#update_last_used_at', :clean_gitlab_redis_shared_state do
it 'updates the last_used_at timestamp' do
expect(subject.last_used_at).to be_nil