Sha256: c40e0f793856e2c5a448953d65a3cd8d279458c62d5ad7f5adad8518fec69103

Contents?: true

Size: 1.16 KB

Versions: 67

Compression:

Stored size: 1.16 KB

Contents

require "pact_broker/matrix/quick_row"
require "pact_broker/ui/view_models/matrix_line"

module PactBroker
  module UI
    module ViewDomain
      describe MatrixLine do
        let(:line) { instance_spy(PactBroker::Matrix::QuickRow) }

        subject(:matrix_line) { described_class.new(line) }

        describe "#provide_version_order" do
          subject(:provider_version_order) { matrix_line.provider_version_order }

          context "verification execution time exists" do
            let(:verification_executed_at) { Time.now }

            before do
              allow(line).to receive(:verification_executed_at)
                .and_return(verification_executed_at)
            end

            it "returns verification execution timestamp" do
              timestamp = verification_executed_at.to_i

              expect(provider_version_order).to eq(timestamp)
            end
          end

          context "verification execution time does not exist" do
            before do
              allow(line).to receive(:verification_executed_at).and_return(nil)
            end

            it { is_expected.to eq(0) }
          end
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
pact_broker-2.47.0 spec/lib/pact_broker/ui/view_models/matrix_line_spec.rb
pact_broker-2.46.0 spec/lib/pact_broker/ui/view_models/matrix_line_spec.rb
pact_broker-2.45.0 spec/lib/pact_broker/ui/view_models/matrix_line_spec.rb
pact_broker-2.44.0 spec/lib/pact_broker/ui/view_models/matrix_line_spec.rb
pact_broker-2.43.0 spec/lib/pact_broker/ui/view_models/matrix_line_spec.rb
pact_broker-2.42.0 spec/lib/pact_broker/ui/view_models/matrix_line_spec.rb
pact_broker-2.41.0 spec/lib/pact_broker/ui/view_models/matrix_line_spec.rb