Sha256: a70e494aad92bcc069263edace7788a5732b423073ee9940a909af3e8df754f8

Contents?: true

Size: 1.37 KB

Versions: 18

Compression:

Stored size: 1.37 KB

Contents

require 'spec_helper'

module Logical
  module Naf

    describe MachineRunnerInvocation do

    	let!(:machine_runner) { FactoryGirl.create(:machine_runner) }
    	let!(:machine) { ::Logical::Naf::Machine.new(machine_runner.machine) }
    	let!(:invocation1) { FactoryGirl.create(:machine_runner_invocation, machine_runner: machine_runner) }
    	let!(:invocation2) { FactoryGirl.create(:machine_runner_invocation, machine_runner: machine_runner) }
    	let!(:invocations) {
    		[[invocation1.id,
    			invocation1.created_at.to_s,
    			invocation1.machine_runner_id,
    			[machine.id, machine.name.to_s],
    			invocation1.pid,
    			invocation1.status.gsub('-', ' ').split.map(&:capitalize).join(' '),
    			invocation1.commit_information,
    			invocation1.deployment_tag,
    			invocation1.repository_name],
    		 [invocation2.id,
    		 	invocation2.created_at.to_s,
    		 	invocation2.machine_runner_id,
    		 	[machine.id, machine.name.to_s],
    		 	invocation2.pid,
    			invocation2.status.gsub('-', ' ').split.map(&:capitalize).join(' '),
    			invocation2.commit_information,
    			invocation2.deployment_tag,
    			invocation2.repository_name]]
    	}

    	describe '#to_array' do
    		it 'return invocation information in correct order' do
    			::Logical::Naf::MachineRunnerInvocation.to_array(0, 'asc', nil).should == invocations
    		end
    	end

    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
naf-2.1.13 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.12 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.11 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.10 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.9 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.8 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.6 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.5 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.4 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.3 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.2 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.1 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.1.0 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.0.4 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.0.3 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.0.2 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.0.1 spec/models/logical/naf/machine_runner_invocation_spec.rb
naf-2.0.0 spec/models/logical/naf/machine_runner_invocation_spec.rb