test/experiment_test.rb in verdict-0.4.1 vs test/experiment_test.rb in verdict-0.5.0
- old
+ new
@@ -73,9 +73,25 @@
assert_equal :a, e.switch(1)
assert_equal :b, e.switch(2)
assert_equal nil, e.switch(3)
end
+ def test_experiment_without_manual_assignment_timestamps_option
+ e = Verdict::Experiment.new('test') do
+ groups { group :all, 100 }
+ end
+
+ refute e.manual_assignment_timestamps?
+ end
+
+ def test_experiment_with_manual_assignment_timestamps_option
+ e = Verdict::Experiment.new('test', manual_assignment_timestamps: true) do
+ groups { group :all, 100 }
+ end
+
+ assert e.manual_assignment_timestamps?
+ end
+
def test_subject_identifier
e = Verdict::Experiment.new('test')
assert_equal '123', e.retrieve_subject_identifier(stub(id: 123, to_s: '456'))
assert_equal '456', e.retrieve_subject_identifier(stub(to_s: '456'))
assert_raises(Verdict::EmptySubjectIdentifier) { e.retrieve_subject_identifier(stub(id: nil)) }