Sha256: 11e002f8eb5d6367f3a03613f62c0d48a50328ef4ffa372f555e3a83d763f3d2
Contents?: true
Size: 1.71 KB
Versions: 18
Compression:
Stored size: 1.71 KB
Contents
require 'spec_helper' require 'flydata/helper/action_ownership' module Flydata module Helper describe ActionOwnership do describe '#initialize' do let(:action_name) { 'stop_agent' } let(:action_class) { Action::StopAgent } subject { described_class.new(action_name, true, action_class) } it { expect(subject.action_name).to eq(action_name) } it { expect(subject.resource_change).to eq(true) } it { expect(subject.action_class).to eq(action_class) } it { expect(subject.owner).to eq(nil) } it { expect(subject.last_processed_time).to eq(-1) } end describe '#processing?' do let(:action_name) { 'stop_agent' } let(:action_class) { Action::StopAgent } let(:ownership) { described_class.new(action_name, true, action_class) } subject { ownership.processing? } context 'when owner is not set' do it { expect(subject).to be(false) } end context 'when owner is set' do before { ownership.owner = 'test-owner' } it { expect(subject).to be(true) } end end describe '.action_ownership_map' do subject { described_class.action_ownership_map } it do expect(subject.include?(:check_remote_actions)).to be(true) expect(subject.include?(:check_abnormal_shutdown)).to be(true) expect(subject.include?(:send_logs)).to be(true) expect(subject.include?(:stop_agent)).to be(true) expect(subject.include?(:restart_agent)).to be(true) expect(subject.include?(:update_helper_config)).to be(true) expect(subject.include?(:repair)).to be(true) end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems