Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Test ENV condition #1361

Closed
Closed
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
4 changes: 1 addition & 3 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ def upload_avatar
end
end
responds_to_parent do
# Without return RSpec2 screams bloody murder about rendering twice:
# within the block and after yield in responds_to_parent.
render && (return if Rails.env.test?)
render
end
end
end
Expand Down
16 changes: 7 additions & 9 deletions lib/fat_free_crm/gem_ext/action_controller/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
unless Rails.env.test?
class ActionController::Base
# Remove helpers residing in subdirectories from the list of application
# helpers. Basically we don't want helpers in app/helpers/admin/* to
# override the ones in app/helpers/*.
#----------------------------------------------------------------------------
def self.all_application_helpers
super.delete_if { |helper| helper.include?(File::SEPARATOR) }
end
class ActionController::Base
# Remove helpers residing in subdirectories from the list of application
# helpers. Basically we don't want helpers in app/helpers/admin/* to
# override the ones in app/helpers/*.
#----------------------------------------------------------------------------
def self.all_application_helpers
super.delete_if { |helper| helper.include?(File::SEPARATOR) }
end
end
16 changes: 6 additions & 10 deletions lib/fat_free_crm/mail_processor/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ def with_new_emails
discard(uid)
end
rescue Exception => e
if %w[test development].include?(Rails.env)
warn e
warn e.backtrace
end
warn e
warn e.backtrace
log "error processing email: #{e.inspect}", email
discard(uid)
end
Expand Down Expand Up @@ -181,12 +179,10 @@ def sender_has_permissions_for?(asset)
# Centralized logging.
#--------------------------------------------------------------------------------------
def log(message, email = nil)
unless %w[test cucumber].include?(Rails.env)
klass = self.class.to_s.split("::").last
klass << " [Dry Run]" if @dry_run
puts "[#{Time.now.rfc822}] #{klass}: #{message}"
puts "[#{Time.now.rfc822}] #{klass}: From: #{email.from}, Subject: #{email.subject} (#{email.message_id})" if email
end
klass = self.class.to_s.split("::").last
klass << " [Dry Run]" if @dry_run
Rails.logger.info("[#{Time.now.rfc822}] #{klass}: #{message}")
Rails.logger.info("[#{Time.now.rfc822}] #{klass}: From: #{email.from}, Subject: #{email.subject} (#{email.message_id})") if email
end

# Returns the plain-text version of an email, or strips html tags
Expand Down
Loading