spec/polytrix/result_spec.rb in polytrix-0.1.2 vs spec/polytrix/result_spec.rb in polytrix-0.1.3

- old
+ new

@@ -4,41 +4,41 @@ describe Result do describe '#status' do context 'mixed pass/fail' do let(:subject) do Polytrix::Result.new( - validations: [ - { validated_by: 'max', result: 'passed' }, - { validated_by: 'polytrix', result: 'failed' } - ] + validations: { + 'max' => { result: 'passed' }, + 'polytrix' => { result: 'failed', error: 'foo!' } + } ).status end it 'reports the failed status' do is_expected.to eq('failed') end end context 'mix passed/pending/skipped' do let(:subject) do Polytrix::Result.new( - validations: [ - { validated_by: 'max', result: 'passed' }, - { validated_by: 'polytrix', result: 'pending' }, - { validated_by: 'john doe', result: 'skipped' } - ] + validations: { + 'max' => { result: 'passed' }, + 'polytrix' => { result: 'pending' }, + 'john doe' => { result: 'skipped' } + } ).status end it 'reports the passed status' do is_expected.to eq('passed') end end context 'mix pending/skipped' do let(:subject) do Polytrix::Result.new( - validations: [ - { validated_by: 'max', result: 'pending' }, - { validated_by: 'polytrix', result: 'pending' }, - { validated_by: 'john doe', result: 'skipped' } - ] + validations: { + 'max' => { result: 'pending' }, + 'polytrix' => { result: 'pending' }, + 'john doe' => { result: 'skipped' } + } ).status end it 'reports the pending status' do is_expected.to eq('pending') end