mirror of
https://github.com/czhu12/canine.git
synced 2026-05-03 01:49:50 -05:00
39 lines
1.2 KiB
Ruby
39 lines
1.2 KiB
Ruby
# == Schema Information
|
|
#
|
|
# Table name: clusters
|
|
#
|
|
# id :bigint not null, primary key
|
|
# cluster_type :integer default("k8s")
|
|
# kubeconfig :jsonb
|
|
# name :string not null
|
|
# options :jsonb not null
|
|
# skip_tls_verify :boolean default(FALSE), not null
|
|
# status :integer default("initializing"), not null
|
|
# created_at :datetime not null
|
|
# updated_at :datetime not null
|
|
# account_id :bigint not null
|
|
# external_id :string
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_clusters_on_account_id_and_name (account_id,name) UNIQUE
|
|
#
|
|
# Foreign Keys
|
|
#
|
|
# fk_rails_... (account_id => accounts.id)
|
|
#
|
|
require 'rails_helper'
|
|
|
|
RSpec.describe Cluster, type: :model do
|
|
describe '#namespaces' do
|
|
let(:cluster) { create(:cluster) }
|
|
let!(:project) { create(:project, cluster: cluster) }
|
|
let!(:add_on) { create(:add_on, cluster: cluster) }
|
|
|
|
it 'returns the reserved namespaces and project/add_on names' do
|
|
expect(cluster.namespaces).to include(project.namespace)
|
|
expect(cluster.namespaces).to include(add_on.namespace)
|
|
end
|
|
end
|
|
end
|