-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add matrix deployed version spec
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
spec/lib/pact_broker/ui/view_models/matrix_deployed_version_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |