Improved web server detection.

This commit is contained in:
Martin Edenhofer 2016-02-04 13:26:04 +01:00
parent 438bd42b8d
commit 23dc2d9522
3 changed files with 6 additions and 4 deletions

View file

@ -18,7 +18,7 @@ class Observer::Ticket::Notification < ActiveRecord::Observer
EventBuffer.reset
via_web = false
if ENV['RACK_ENV'] || defined? Rails.configuration.webserver_is_active
if ENV['RACK_ENV'] || Rails.configuration.webserver_is_active
via_web = true
end

View file

@ -0,0 +1,2 @@
Rails.configuration.webserver_is_active = false

View file

@ -86,7 +86,7 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert(ticket1)
# execute ticket events
ENV['SERVER_NAME'] = nil
Rails.configuration.webserver_is_active = nil
Observer::Ticket::Notification.transaction
#puts Delayed::Job.all.inspect
Delayed::Worker.new.work_off
@ -121,7 +121,7 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert(ticket1)
# execute ticket events
ENV['SERVER_NAME'] = 'some_host'
Rails.configuration.webserver_is_active = true
Observer::Ticket::Notification.transaction
#puts Delayed::Job.all.inspect
Delayed::Worker.new.work_off
@ -159,7 +159,7 @@ class TicketNotificationTest < ActiveSupport::TestCase
assert( ticket1, 'ticket created - ticket notification simple' )
# execute ticket events
ENV['SERVER_NAME'] = 'some_host'
Rails.configuration.webserver_is_active = true
Observer::Ticket::Notification.transaction
#puts Delayed::Job.all.inspect
Delayed::Worker.new.work_off