Skip to content

Commit 81f9e56

Browse files
committed
adds tests
1 parent 573aded commit 81f9e56

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

spec/flipper/adapters/active_support_cache_store_spec.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
end
99
let(:cache) { ActiveSupport::Cache::MemoryStore.new }
1010
let(:write_through) { false }
11-
let(:adapter) { described_class.new(memory_adapter, cache, 10, write_through: write_through) }
11+
let(:race_condition_ttl) { 5 }
12+
let(:adapter) { described_class.new(memory_adapter, cache, 10, race_condition_ttl: race_condition_ttl, write_through: write_through) }
1213
let(:flipper) { Flipper.new(adapter) }
1314

1415
subject { adapter }
@@ -42,6 +43,15 @@
4243
expect(adapter.ttl).to be(nil)
4344
end
4445

46+
it "knows race_condition_ttl" do
47+
expect(adapter.race_condition_ttl).to eq(race_condition_ttl)
48+
end
49+
50+
it "knows default when no ttl or expires_in provided" do
51+
adapter = described_class.new(memory_adapter, cache)
52+
expect(adapter.race_condition_ttl).to be(nil)
53+
end
54+
4555
it "knows features_cache_key" do
4656
expect(adapter.features_cache_key).to eq("flipper/v1/features")
4757
end

0 commit comments

Comments
 (0)