Refactor ejabberd API integration
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 2s

This commit is contained in:
2025-05-26 14:10:27 +04:00
parent 4bf6985b87
commit d737d9f6b8
19 changed files with 307 additions and 167 deletions

View File

@@ -0,0 +1,25 @@
require 'rails_helper'
RSpec.describe XmppSendMessageJob, type: :job do
let(:payload) {{
type: "normal",
from: "kosmos.org", to: "willherschel@kosmos.org",
body: "This is a test message"
}}
subject(:job) {
described_class.perform_later(payload)
}
it "calls the service for exchanging contacts" do
expect(EjabberdManager::SendMessage).to receive(:call)
.with(payload: payload).and_return(true)
perform_enqueued_jobs { job }
end
after do
clear_enqueued_jobs
clear_performed_jobs
end
end