fixes tests, quiet sidekiq client logger

This commit is contained in:
Kyle Drake 2014-08-30 15:49:03 -07:00
parent 74f5ef31d9
commit 4b94fc65bf
2 changed files with 21 additions and 16 deletions

View file

@ -44,6 +44,7 @@ Sidekiq.configure_server do |config|
end
Sidekiq.configure_client do |config|
config.logger = nil
config.redis = sidekiq_redis_config
end

View file

@ -70,7 +70,7 @@ class Site < Sequel::Model
/PHP\.Hide/
]
SPAM_MATCH_REGEX = /#{$config['spam_smart_filter'].join('|')}/i
SPAM_MATCH_REGEX = ENV['RACK_ENV'] == 'test' ? /pillz/ : /#{$config['spam_smart_filter'].join('|')}/i
EMAIL_SANITY_REGEX = /.+@.+\..+/i
@ -344,7 +344,9 @@ class Site < Sequel::Model
return false
end
open(uploaded.path) { |f| matches = f.grep SPAM_MATCH_REGEX }
if File.extname(relative_path).match /\.#{EDITABLE_FILE_EXT}/
open(uploaded.path) {|f|
matches = f.grep SPAM_MATCH_REGEX
if !matches.empty?
EmailWorker.perform_async({
@ -361,6 +363,8 @@ class Site < Sequel::Model
}
})
end
}
end
pathname = Pathname(path)
if pathname.basename.to_s == 'index.html'