Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jesusbv committed Nov 25, 2024
1 parent 91552ef commit f544bb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@

context 'when system is connected to SCC' do
let(:system_payg) do
FactoryBot.create(:system, :payg, :with_system_information_az, :with_activated_base_product, instance_data: instance_data,
FactoryBot.create(:system, :payg, :with_system_information, :with_activated_base_product, instance_data: instance_data,
system_token: new_system_token)
end
let(:product) do
Expand Down Expand Up @@ -416,7 +416,7 @@
allow(FileUtils).to receive(:mkdir_p)
allow(FileUtils).to receive(:touch)
allow(InstanceVerification::Providers::Example).to receive(:new).and_return(plugin_double)
allow(plugin_double).to receive(:basic?).and_return(false)
allow(plugin_double).to receive(:allowed_extension?).and_return(true)
allow(InstanceVerification).to receive(:write_cache_file).twice.with(
Rails.application.config.repo_cache_dir, "127.0.0.1-#{system_payg.login}-#{product.id}"
)
Expand All @@ -428,7 +428,7 @@

context 'when LTSS not allowed' do
before do
allow(plugin_double).to receive(:basic?).and_return(true)
allow(plugin_double).to receive(:allowed_extension?).and_return(false)
end

it 'raises an error' do
Expand Down Expand Up @@ -463,7 +463,7 @@

context 'when system is connected to SCC' do
let(:system_payg) do
FactoryBot.create(:system, :payg, :with_system_information_az, :with_activated_base_product, instance_data: instance_data,
FactoryBot.create(:system, :payg, :with_system_information, :with_activated_base_product, instance_data: instance_data,
system_token: new_system_token)
end
let(:product) do
Expand Down
13 changes: 0 additions & 13 deletions spec/factories/systems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,6 @@
end
end

trait :with_system_information_az do
system_information do
{
cpus: 2,
sockets: 1,
hypervisor: nil,
arch: 'x86_64',
uuid: SecureRandom.uuid,
cloud_provider: 'Microsoft'
}.to_json
end
end

trait :with_system_token do
sequence(:system_token) { |n| "00000000-0000-4000-9000-#{n.to_s.rjust(12, '0')}" }
end
Expand Down

0 comments on commit f544bb0

Please sign in to comment.