Sha256: c28817a82fd611784ca830e7f9ddddd98285ed7c9051af4d3b426f4dd865f194

Contents?: true

Size: 1002 Bytes

Versions: 43

Compression:

Stored size: 1002 Bytes

Contents

require 'spec_helper'
require 'job_helper'

describe Marty::Diagnostic::DelayedJobVersion do
  # used to stub request object
  class DummyRequest
    attr_accessor :params, :port
    def initialize
      @params = {}
    end
  end

  before(:each) do
    Marty::Script.load_scripts(nil, Date.today)
    allow(described_class).to receive(:scope).and_return(nil)
  end

  def sample_data
    {
      Marty::Helper.my_ip => {
        'Version' => {
          'description' => Marty::VERSION,
          'status'      => true,
          'consistent'  => nil
        },
      }
    }
  end

  it 'can detect if all workers are running correct application version' do
    ENV['DELAYED_VER'] = Marty::VERSION
    start_delayed_job
    expect(described_class.generate).to eq(sample_data)
    stop_delayed_job
  end

  it 'will fail if DELAYED_VER is not set' do
    ENV.delete('DELAYED_VER')
    start_delayed_job
    expect{described_class.generate}.to raise_error(RuntimeError)
    stop_delayed_job
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
marty-2.5.2 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.5.1 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.5.0 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.9 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.8 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.7 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.6 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.5 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.4 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.3 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.2 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.1 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.4.0 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.3.15 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.3.14 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.3.13 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.3.12 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.3.11 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.3.10 spec/other/diagnostic/delayed_job_version_spec.rb
marty-2.3.9 spec/other/diagnostic/delayed_job_version_spec.rb