Sha256: b1a9312c05c907017622127644cb4a86c298a1c8b5b8a4aa7df3cc822041ab35

Contents?: true

Size: 603 Bytes

Versions: 2

Compression:

Stored size: 603 Bytes

Contents

FactoryBot.define do
  factory :host, class: 'SSHTunnel::UI::Models::Host' do

    uuid { '7be48819-97bf-49fc-98af-4f7f096e1977' }
    name { 'foo' }
    user { 'root' }
    host { 'host.example.net' }
    port { 22 }

    factory :host_with_one_tunnel do
      after(:build) do |object, _evaluator|
        object.tunnels = [build(:tunnel, parent: object)]
      end
    end

    factory :host_with_two_tunnels do
      after(:build) do |object, _evaluator|
        object.tunnels = [build(:tunnel, name: 'zzz', parent: object), build(:tunnel, name: 'aaa', parent: object)]
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ssh-hull-2.0 spec/factories/host.rb
ssh-hull-1.0.0 spec/factories/host.rb