Skip to content

Commit

Permalink
ADO 19603: Allow Email Suggestion to be Skipped
Browse files Browse the repository at this point in the history
* Fix a few deprecation warnings that were introduced in version
  4.2.0 of the redis gem [1].
* As the data store API is internal, no longer check the result of
  a single step of a multi-transaction commit in redis. Remove
  the corresponding specs as well.

[1]: redis/redis-rb#876
SEE: https://dev.azure.com/AMA-Ent/AMA-Ent/_workitems/edit/19603
  • Loading branch information
Jesse Doyle committed Mar 5, 2021
1 parent bad8d9f commit 9622e2c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion ama_layout.gemspec
Expand Up @@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'breadcrumbs_on_rails', '>= 3'
spec.add_dependency 'browser', '~> 2.0'
spec.add_dependency 'foundation-rails', '<= 6.4.3.0'
spec.add_dependency 'rails', '>= 4.2', '<= 6'
spec.add_dependency 'rails', '>= 4.2', '< 6.1'
spec.add_dependency 'redis-rails'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'combustion'
Expand Down
4 changes: 2 additions & 2 deletions lib/ama_layout/notifications/redis_store.rb
Expand Up @@ -21,11 +21,11 @@ def get(key, opts = {})
end

def set(key, value, opts = {})
base.write(key, value, opts) == 'OK'
base.write(key, value, opts)
end

def delete(key, opts = {})
base.delete(key, opts) == 1
base.delete(key, opts)
end

def transaction
Expand Down
6 changes: 0 additions & 6 deletions spec/ama_layout/notification_set_spec.rb
Expand Up @@ -207,12 +207,6 @@
expect(subject.destroy!).to be_empty
end
end

context 'when data is not removed' do
it 'returns false' do
expect(subject.destroy!).to be false
end
end
end

describe '#find' do
Expand Down
14 changes: 0 additions & 14 deletions spec/ama_layout/notifications/redis_store_spec.rb
Expand Up @@ -43,10 +43,6 @@
subject.set('test', 'value')
expect(subject.get('test')).to eq('value')
end

it 'returns true' do
expect(subject.set('test', 'value')).to be true
end
end

describe '#delete' do
Expand All @@ -55,21 +51,11 @@
subject.set('key', 'value')
end

it 'returns true' do
expect(subject.delete('key')).to be true
end

it 'deletes the key' do
subject.delete('key')
expect(subject.get('key')).to be nil
end
end

context 'when a value is not deleted' do
it 'returns false' do
expect(subject.delete('key')).to be false
end
end
end

describe '#transaction' do
Expand Down

0 comments on commit 9622e2c

Please sign in to comment.