Skip to content

Commit

Permalink
Merge pull request #1833 from tactilenews/fix_signal_receive_polling_…
Browse files Browse the repository at this point in the history
…job_specs_run_in_docker

Fix specs failing when run in docker
  • Loading branch information
mattwr18 authored Apr 18, 2024
2 parents 7f36366 + 2f4b5ad commit 4a8765c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ POSTGRES_USER=
TELEGRAM_BOT_API_KEY=TOKEN
TELEGRAM_BOT_USERNAME=NameOfYourBot

SIGNAL_SERVER_PHONE_NUMBER="+4912345789"
SIGNAL_SERVER_PHONE_NUMBER="+4987654321"

EMAIL_FROM_ADDRESS=test@example.org

Expand Down
1 change: 0 additions & 1 deletion app/adapters/signal_adapter/inbound.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def trigger(event, *args)
def initialize_sender(signal_message)
signal_phone_number = signal_message.dig(:envelope, :source)
sender = Contributor.find_by(signal_phone_number: signal_phone_number)
return nil if signal_phone_number == Setting.signal_server_phone_number

unless sender
trigger(UNKNOWN_CONTRIBUTOR, signal_phone_number)
Expand Down
1 change: 1 addition & 0 deletions spec/jobs/signal_adapter/receive_polling_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
create(:request)

allow(Setting).to receive(:signal_server_phone_number).and_return('SIGNAL_SERVER_PHONE_NUMBER')
allow(Setting).to receive(:signal_cli_rest_api_endpoint).and_return('http://localhost:8080')
allow(job).to receive(:ping_monitoring_service).and_return(nil)
end

Expand Down
8 changes: 4 additions & 4 deletions spec/vcr_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
VCR.configure do |c|
c.cassette_library_dir = 'vcr_cassettes'
c.hook_into :webmock
c.filter_sensitive_data('TELEGRAM_BOT_API_KEY') { ENV.fetch('TELEGRAM_BOT_API_KEY', nil) }
c.filter_sensitive_data('TELEGRAM_BOT_USERNAME') { ENV.fetch('TELEGRAM_BOT_USERNAME', nil) }
c.filter_sensitive_data('*100EYES') { ENV.fetch('THREEMARB_API_IDENTITY', nil) }
c.filter_sensitive_data('TELEGRAM_BOT_API_KEY') { Setting.telegram_bot_api_key }
c.filter_sensitive_data('TELEGRAM_BOT_USERNAME') { Setting.telegram_bot_username }
c.filter_sensitive_data('*100EYES') { Setting.threemarb_api_identity }
c.filter_sensitive_data('THREEMARB_API_SECRET') { ENV.fetch('THREEMARB_API_SECRET', nil) }
c.filter_sensitive_data('THREEMARB_PRIVATE') { ENV.fetch('THREEMARB_PRIVATE', nil) }
c.filter_sensitive_data('SIGNAL_SERVER_PHONE_NUMBER') { ENV.fetch('SIGNAL_SERVER_PHONE_NUMBER', nil) }
c.filter_sensitive_data('SIGNAL_SERVER_PHONE_NUMBER') { Setting.signal_server_phone_number }

c.configure_rspec_metadata!

Expand Down

0 comments on commit 4a8765c

Please sign in to comment.