Revision 50c5bf86
Added by Marek Hulán over 6 years ago
test/factories/compute_resources.rb | ||
---|---|---|
FactoryGirl.define do
|
||
FactoryBot.define do
|
||
factory :container_resource, :class => ComputeResource do
|
||
sequence(:name) { |n| "compute_resource#{n}" }
|
||
|
test/test_plugin_helper.rb | ||
---|---|---|
# This calls the main test_helper in Foreman core
|
||
require 'test_helper'
|
||
|
||
# Add plugin to FactoryGirl's paths
|
||
FactoryGirl.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
|
||
FactoryGirl.reload
|
||
# Add plugin to FactoryBot's paths
|
||
FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
|
||
FactoryBot.reload
|
test/unit/foreman_digitalocean/digitalocean_test.rb | ||
---|---|---|
teardown { Fog.unmock! }
|
||
|
||
test 'ssh key pair gets created after its saved' do
|
||
digitalocean = FactoryGirl.build(:digitalocean_cr)
|
||
digitalocean = FactoryBot.build(:digitalocean_cr)
|
||
digitalocean.expects(:setup_key_pair)
|
||
digitalocean.save
|
||
end
|
Also available in: Unified diff
Fixes #21533 - start using factory bot