Commit 944149ec authored by Shinya Maeda's avatar Shinya Maeda

spec for spec/presenters

parent c43a82cd
require 'spec_helper' require 'spec_helper'
describe Gcp::ClusterPresenter do describe Clusters::ClusterPresenter do
let(:project) { create(:project) } let(:cluster) { create(:cluster, :provided_by_gcp) }
let(:cluster) { create(:gcp_cluster, project: project) }
subject(:presenter) do subject(:presenter) do
described_class.new(cluster) described_class.new(cluster)
...@@ -22,14 +21,14 @@ describe Gcp::ClusterPresenter do ...@@ -22,14 +21,14 @@ describe Gcp::ClusterPresenter do
end end
it 'forwards missing methods to cluster' do it 'forwards missing methods to cluster' do
expect(presenter.gcp_cluster_zone).to eq(cluster.gcp_cluster_zone) expect(presenter.status).to eq(cluster.status)
end end
end end
describe '#gke_cluster_url' do describe '#gke_cluster_url' do
subject { described_class.new(cluster).gke_cluster_url } subject { described_class.new(cluster).gke_cluster_url }
it { is_expected.to include(cluster.gcp_cluster_zone) } it { is_expected.to include(cluster.provider.zone) }
it { is_expected.to include(cluster.gcp_cluster_name) } it { is_expected.to include(cluster.name) }
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment