test/assignment_test.rb in verdict-0.5.0 vs test/assignment_test.rb in verdict-0.6.0

- old
+ new

@@ -26,16 +26,15 @@ assert_equal nil, non_assignment.to_sym assert_equal nil, non_assignment.handle assert_kind_of Time, assignment.created_at end - def test_subject_lookup - assignment = Verdict::Assignment.new(@experiment, 'test_subject_id', nil, Time.now.utc) - assert_raises(NotImplementedError) { assignment.subject } + def test_subject_identifier_lookup + klass = Struct.new(:id) + subject = klass.new(123) - @experiment.expects(:fetch_subject).with('test_subject_id').returns(subject = mock('subject')) - assignment = Verdict::Assignment.new(@experiment, 'test_subject_id', nil, Time.now.utc) - assert_equal subject, assignment.subject + assignment = Verdict::Assignment.new(@experiment, subject, nil, Time.now.utc) + assert_equal '123', assignment.subject_identifier end def test_triple_equals assignment = Verdict::Assignment.new(@experiment, 'test_subject_id', @group, Time.now.utc) assert !(assignment === nil)