Skip to content

Commit

Permalink
test: add matrix deployed version spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Feb 24, 2021
1 parent 20a5f42 commit 29a54b6
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
require 'pact_broker/ui/view_models/matrix_deployed_version'

module PactBroker
module UI
module ViewDomain
describe MatrixDeployedVersion do
before do
allow(subject).to receive(:deployed_version_url).and_return("http://deployed_version")
allow(subject).to receive(:hal_browser_url) do | url |
"http://halbrowser#" + url
end
end
subject(:matrix_deployed_version) { MatrixDeployedVersion.new(deployed_version) }
let(:deployed_version) do
instance_double("PactBroker::Deployments::DeployedVersion",
environment: environment,
created_at: created_at
)
end
let(:created_at) { (Date.today - 1).to_datetime }
let(:environment) { instance_double("PactBroker::Deployments::Environment", name: "test", display_name: "Test") }

its(:environment_name) { is_expected.to eq "test" }
its(:tooltip) { is_expected.to eq "Currently deployed to Test (1 day ago)" }
its(:url) { is_expected.to eq "http://halbrowser#http://deployed_version" }
end
end
end
end

0 comments on commit 29a54b6

Please sign in to comment.