Files
leadchat/spec/jobs/internal/check_new_versions_job_spec.rb

15 lines
492 B
Ruby

require 'rails_helper'
RSpec.describe Internal::CheckNewVersionsJob do
subject(:job) { described_class.perform_now }
it 'updates the latest chatwoot version in redis' do
version = '1.1.1'
allow(Rails.env).to receive(:production?).and_return(true)
allow(ChatwootHub).to receive(:latest_version).and_return(version)
job
expect(ChatwootHub).to have_received(:latest_version)
expect(Redis::Alfred.get(Redis::Alfred::LATEST_CHATWOOT_VERSION)).to eq version
end
end