Sha256: b8e25daba5fa065962df5d56019b81676f7ac2ce890484b167ce21b738f75fcd

Contents?: true

Size: 1.37 KB

Versions: 4

Compression:

Stored size: 1.37 KB

Contents

require 'spec_helper'

module Polytrix
  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' }
            ]
          ).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' }
            ]
          ).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' }
            ]
          ).status
        end
        it 'reports the pending status' do
          is_expected.to eq('pending')
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
polytrix-0.1.2 spec/polytrix/result_spec.rb
polytrix-0.1.1 spec/polytrix/result_spec.rb
polytrix-0.1.0 spec/polytrix/result_spec.rb
polytrix-0.1.0.pre spec/polytrix/result_spec.rb