Sha256: 616ea63696bdb7201497c96daa1423a275693beb920958aa1e3c0570361e2f18

Contents?: true

Size: 1.05 KB

Versions: 40

Compression:

Stored size: 1.05 KB

Contents

require 'test_helper'

module Shipit
  class FetchDeployedRevisionJobTest < ActiveSupport::TestCase
    setup do
      @stack = shipit_stacks(:shipit)
      @job = FetchDeployedRevisionJob.new
      @commit = shipit_commits(:fifth)
    end

    test 'the job abort if the stack is deploying' do
      @stack.expects(:active_task?).returns(true)
      assert_no_difference 'Deploy.count' do
        @job.perform(@stack)
      end
    end

    test 'the job abort if #fetch_deployed_revision returns nil' do
      @stack.expects(:active_task?).returns(false)
      StackCommands.any_instance.expects(:fetch_deployed_revision).returns(nil)
      @stack.expects(:update_deployed_revision).never
      @job.perform(@stack)
    end

    test 'the job call update_deployed_revision if #fetch_deployed_revision returns something' do
      @stack.expects(:active_task?).returns(false)
      StackCommands.any_instance.expects(:fetch_deployed_revision).returns(@commit.sha)
      @stack.expects(:update_deployed_revision).with(@commit.sha)
      @job.perform(@stack)
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
shipit-engine-0.31.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.30.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.29.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.28.1 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.28.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.27.1 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.27.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.26.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.25.1 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.25.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.24.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.23.1 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.23.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.22.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.21.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.20.1 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.20.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.19.0 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.18.1 test/jobs/fetch_deployed_revision_job_test.rb
shipit-engine-0.18.0 test/jobs/fetch_deployed_revision_job_test.rb