Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
--health-timeout 5s
--health-retries 5

redis:
image: redis:latest
ports:
- 6379:6379

env:
RAILS_ENV: test
DATABASE_HOST: localhost
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/event_created_job.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class EventCreatedJob
include Sidekiq::Job

sidekiq_options queue: 'reporting', retry: false, backtrace: true
sidekiq_options queue: 'events', retry: false, backtrace: true

def perform(args)
case args['type']
Expand Down
3 changes: 0 additions & 3 deletions script/accountify/invoice/test_lifecycle.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require_relative '../../../config/environment'

# require 'time'
require 'open3'

user_id = 123
Expand All @@ -14,8 +13,6 @@
tenant_id: tenant_id,
name: 'Debbies Debts Ltd')

sleep 1

contact = Accountify::Contact.create(
user_id: user_id,
tenant_id: tenant_id,
Expand Down
16 changes: 10 additions & 6 deletions spec/integration/accountify/invoice/test_lifecycle_spec.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
require 'rails_helper'

RSpec.describe 'Invoice Lifecycle', type: :integration do
it 'runs the test lifecycle script' do
# TODO: work out why this fails
it 'transitions as expected' do
Sidekiq::Testing.disable!

# load Rails.root.join('script/accountify/invoice/test_lifecycle.rb')
begin
load Rails.root.join('script/accountify/invoice/test_lifecycle.rb')

# expect(Accountify::Models::Organisation.count).to eq(1)
# expect(Accountify::Models::Contact.count).to eq(1)
# expect(Accountify::Models::Invoice.count).to eq(1)
expect(Accountify::Models::Organisation.count).to eq(1)
expect(Accountify::Models::Contact.count).to eq(1)
expect(Accountify::Models::Invoice.count).to eq(1)
ensure
Sidekiq::Testing.fake!
end
end
end
Loading