spec/user_spec.rb in split-3.4.1 vs spec/user_spec.rb in split-4.0.0.pre
- old
+ new
@@ -70,9 +70,26 @@
@subject.cleanup_old_experiments!
end
end
end
+ context 'allows user to be loaded from adapter' do
+ it 'loads user from adapter (RedisAdapter)' do
+ user = Split::Persistence::RedisAdapter.new(nil, 112233)
+ user['foo'] = 'bar'
+
+ ab_user = Split::User.find(112233, :redis)
+
+ expect(ab_user['foo']).to eql('bar')
+ end
+
+ it 'returns nil if adapter does not implement a finder method' do
+ ab_user = Split::User.find(112233, :dual_adapter)
+ expect(ab_user).to be_nil
+ end
+
+ end
+
context "instantiated with custom adapter" do
let(:custom_adapter) { double(:persistence_adapter) }
before do
@subject = described_class.new(context, custom_adapter)