Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
bangn committed Nov 15, 2021
1 parent e16897c commit 3cbf433
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions spec/lib/pact_broker/ui/view_models/index_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module ViewDomain
let(:latest_pact) { instance_double("PactBroker::Domain::Pact", consumer_version_number: "1.2.3") }
let(:latest_verification) { instance_double("PactBroker::Domain::Verification") }
let(:domain_relationship) { PactBroker::Domain::IndexItem.new(consumer, provider, consumer_version, latest_pact, latest, latest_verification, [], [], tags, latest_verification_latest_tags)}
let(:very_long_tag) { "This_is_a_rediculously_long_tag_names_It_will_be_truncated_in_the_middle" }
let(:expected_truncate_tag) { "This_is_a_...the_middle" }
let(:tags) { [] }
let(:verification_tag_1) { instance_double("PactBroker::Tags::TagWithLatestFlag", name: "dev") }
Expand Down Expand Up @@ -138,22 +137,12 @@ module ViewDomain
let(:tags) { ["master", "prod"] }
its(:consumer_version_latest_tag_names) { is_expected.to eq ["master", "prod"] }
end

context "when tags is too long" do
let(:tags) { [very_long_tag] }
its(:consumer_version_latest_tag_names) { is_expected.to eq [expected_truncate_tag] }
end
end

describe "provider_version_latest_tag_names" do
context "when tags is short" do
its(:provider_version_latest_tag_names) { is_expected.to eq ["dev", "prod"] }
end

context "when tags is too long" do
let(:verification_tag_1) { instance_double( "PactBroker::Tags::TagWithLatestFlag", name: very_long_tag) }
its(:provider_version_latest_tag_names) { is_expected.to eq [expected_truncate_tag, "prod"] }
end
end

describe "pact_tags" do
Expand All @@ -166,16 +155,6 @@ module ViewDomain
].to_json)
end
end

context "when tags is too long" do
let(:tags) { [very_long_tag, "prod"] }
its(:pact_tags) do
is_expected.to eq([
{ name: expected_truncate_tag, deletionUrl: "/pacts/provider/Provider%20Name/consumer/Consumer%20Name/tag/#{very_long_tag}" },
{ name: "prod", deletionUrl: "/pacts/provider/Provider%20Name/consumer/Consumer%20Name/tag/prod" }
].to_json)
end
end
end

describe "<=>" do
Expand Down

0 comments on commit 3cbf433

Please sign in to comment.