Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-12-18 00:54:24 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-12-18 00:57:03 +0300
commit279be8aaa28a1f5c6e6e8601eb0df579cbaf1eeb (patch)
tree8db4b368665579121cd9397eaf643b8b93ffa9c1 /spec/lib/gitlab/safe_request_store_spec.rb
parentf515c25fe8256a09e0360ce9345279928daa3aab (diff)
Change SafeRequestStore#write to accept an options hash
This change the write to accept an options hash to make it compatible with ActiveSupport::Cache::Store#write method. The options hash are not passed to the underlying cache implementation because RequestStore#write accepts only a key, and value params.
Diffstat (limited to 'spec/lib/gitlab/safe_request_store_spec.rb')
-rw-r--r--spec/lib/gitlab/safe_request_store_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/safe_request_store_spec.rb b/spec/lib/gitlab/safe_request_store_spec.rb
index c797171dbe2..bae87e43615 100644
--- a/spec/lib/gitlab/safe_request_store_spec.rb
+++ b/spec/lib/gitlab/safe_request_store_spec.rb
@@ -78,6 +78,12 @@ describe Gitlab::SafeRequestStore do
described_class.write('foo', true)
end.to change { described_class.read('foo') }.from(nil).to(true)
end
+
+ it 'does not pass the options hash to the underlying store implementation' do
+ expect(described_class.store).to receive(:write).with('foo', true)
+
+ described_class.write('foo', true, expires_in: 15.seconds)
+ end
end
context 'when RequestStore is NOT active' do
@@ -86,6 +92,12 @@ describe Gitlab::SafeRequestStore do
described_class.write('foo', true)
end.not_to change { described_class.read('foo') }.from(nil)
end
+
+ it 'does not pass the options hash to the underlying store implementation' do
+ expect(described_class.store).to receive(:write).with('foo', true)
+
+ described_class.write('foo', true, expires_in: 15.seconds)
+ end
end
end