Skip to content
Snippets Groups Projects
Commit f9364929 authored by Alessio Caiazza's avatar Alessio Caiazza
Browse files

Rename application_helm factory to cluster_application_helm

parent 8638cf66
No related branches found
No related tags found
No related merge requests found
FactoryGirl.define do
factory :applications_helm, class: Clusters::Applications::Helm do
trait :cluster do
before(:create) do |app, _|
app.cluster = create(:cluster)
end
end
factory :cluster_applications_helm, class: Clusters::Applications::Helm do
cluster factory: :cluster
 
trait :installable do
cluster
Loading
Loading
Loading
Loading
@@ -28,7 +28,7 @@ RSpec.describe Clusters::Applications::Helm, type: :model do
 
describe 'status state machine' do
describe '#make_installing' do
subject { create(:applications_helm, :scheduled) }
subject { create(:cluster_applications_helm, :scheduled) }
 
it 'is installing' do
subject.make_installing!
Loading
Loading
@@ -38,7 +38,7 @@ RSpec.describe Clusters::Applications::Helm, type: :model do
end
 
describe '#make_installed' do
subject { create(:applications_helm, :installing) }
subject { create(:cluster_applications_helm, :installing) }
 
it 'is installed' do
subject.make_installed
Loading
Loading
@@ -48,7 +48,7 @@ RSpec.describe Clusters::Applications::Helm, type: :model do
end
 
describe '#make_errored' do
subject { create(:applications_helm, :installing) }
subject { create(:cluster_applications_helm, :installing) }
let(:reason) { 'some errors' }
 
it 'is errored' do
Loading
Loading
@@ -60,7 +60,7 @@ RSpec.describe Clusters::Applications::Helm, type: :model do
end
 
describe '#make_scheduled' do
subject { create(:applications_helm, :installable) }
subject { create(:cluster_applications_helm, :installable) }
 
it 'is scheduled' do
subject.make_scheduled
Loading
Loading
@@ -69,7 +69,7 @@ RSpec.describe Clusters::Applications::Helm, type: :model do
end
 
describe 'when was errored' do
subject { create(:applications_helm, :errored) }
subject { create(:cluster_applications_helm, :errored) }
 
it 'clears #status_reason' do
expect(subject.status_reason).not_to be_nil
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@ require 'spec_helper'
 
describe ClusterApplicationEntity do
describe '#as_json' do
let(:application) { build(:applications_helm) }
let(:application) { build(:cluster_applications_helm) }
subject { described_class.new(application).as_json }
 
it 'has name' do
Loading
Loading
@@ -18,7 +18,7 @@ describe ClusterApplicationEntity do
end
 
context 'when application is errored' do
let(:application) { build(:applications_helm, :errored) }
let(:application) { build(:cluster_applications_helm, :errored) }
 
it 'has corresponded data' do
expect(subject[:status]).to eq(:errored)
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@ require 'spec_helper'
describe Clusters::Applications::CheckInstallationProgressService do
RESCHEDULE_PHASES = Gitlab::Kubernetes::Pod::PHASES - [Gitlab::Kubernetes::Pod::SUCCEEDED, Gitlab::Kubernetes::Pod::FAILED].freeze
 
let(:application) { create(:applications_helm, :installing) }
let(:application) { create(:cluster_applications_helm, :installing) }
let(:service) { described_class.new(application) }
let(:phase) { Gitlab::Kubernetes::Pod::UNKNOWN }
let(:errors) { nil }
Loading
Loading
@@ -33,7 +33,7 @@ describe Clusters::Applications::CheckInstallationProgressService do
end
 
context 'when timeouted' do
let(:application) { create(:applications_helm, :timeouted) }
let(:application) { create(:cluster_applications_helm, :timeouted) }
 
it_behaves_like 'a terminated installation'
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,7 @@ require 'spec_helper'
 
describe Clusters::Applications::InstallService do
describe '#execute' do
let(:application) { create(:applications_helm, :scheduled) }
let(:application) { create(:cluster_applications_helm, :scheduled) }
let(:service) { described_class.new(application) }
 
context 'when there are no errors' do
Loading
Loading
@@ -39,7 +39,7 @@ describe Clusters::Applications::InstallService do
end
 
context 'when application cannot be persisted' do
let(:application) { build(:applications_helm, :scheduled) }
let(:application) { build(:cluster_applications_helm, :scheduled) }
 
it 'make the application errored' do
expect(application).to receive(:make_installing!).once.and_raise(ActiveRecord::RecordInvalid)
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ describe Clusters::Applications::ScheduleInstallationService do
end
 
context 'when installation is already in progress' do
let(:application) { create(:applications_helm, :installing) }
let(:application) { create(:cluster_applications_helm, :installing) }
let(:cluster) { application.cluster }
 
it_behaves_like 'a failing service'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment