diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 03:08:01 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 03:08:01 +0000 |
commit | 796b00a98a82fcbe082c9343fd4efcccc77478dc (patch) | |
tree | 257bcb124f57cb91a8dff75e69649e8a2f91c51d /spec/models/chat_name_spec.rb | |
parent | 93dcf45d441bc884b167f4338380c8c888e9b86f (diff) | |
download | gitlab-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.rb | 6 |
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 |