Sha256: 5f74477edc4dd14d5537b78e4a19c4573126817591547708ba38fa16ae2a8764

Contents?: true

Size: 1010 Bytes

Versions: 11

Compression:

Stored size: 1010 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, Time.zone.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

11 entries across 11 versions & 1 rubygems

Version Path
marty-14.3.0 spec/other/diagnostic/delayed_job_version_spec.rb
marty-14.0.0 spec/other/diagnostic/delayed_job_version_spec.rb
marty-13.0.2 spec/other/diagnostic/delayed_job_version_spec.rb
marty-11.0.0 spec/other/diagnostic/delayed_job_version_spec.rb
marty-10.0.3 spec/other/diagnostic/delayed_job_version_spec.rb
marty-10.0.2 spec/other/diagnostic/delayed_job_version_spec.rb
marty-10.0.0 spec/other/diagnostic/delayed_job_version_spec.rb
marty-9.5.1 spec/other/diagnostic/delayed_job_version_spec.rb
marty-9.5.0 spec/other/diagnostic/delayed_job_version_spec.rb
marty-9.3.3 spec/other/diagnostic/delayed_job_version_spec.rb
marty-9.3.2 spec/other/diagnostic/delayed_job_version_spec.rb