diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-27 10:20:09 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2018-02-27 10:20:09 +0000 |
commit | 60503057bcf357bef82e3e61072d2a2646f62279 (patch) | |
tree | 48e234ba8450dd8786c42bcfa157987a5ec0b567 /spec/models | |
parent | a4885b8f37602c399efff028b0a733ef80fbe7ab (diff) | |
parent | 57719d34d3fcc15f39354b0e9dc1da41bbe5d1a8 (diff) | |
download | gitlab-ce-60503057bcf357bef82e3e61072d2a2646f62279.tar.gz |
Merge branch 'slash-commands-changes-for-chatops' into 'master'
Expose ChatName objects to slash commands
See merge request gitlab-org/gitlab-ce!17295
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/chat_name_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/chat_name_spec.rb b/spec/models/chat_name_spec.rb index e89e534d914..504bc710b25 100644 --- a/spec/models/chat_name_spec.rb +++ b/spec/models/chat_name_spec.rb @@ -14,4 +14,24 @@ 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) } + + 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 + + subject.update_last_used_at + + expect(subject.last_used_at).to be_present + end + + it 'does not update last_used_at if it was recently updated' do + subject.update_last_used_at + + time = subject.last_used_at + + subject.update_last_used_at + + expect(subject.last_used_at).to eq(time) + end + end end |