Project

General

Profile

« Previous | Next » 

Revision 76607ed5

Added by Ohad Levy almost 13 years ago

  • ID 76607ed5fc692646c4b31791eea9c71a903e8f17

fixes #100 - Setting is now a ActiveRecord object

This allows users to manage foreman settings via the UI.

the UI is a bit ugly, but works :)

View differences:

test/unit/report_test.rb
def setup_for_email_reporting
# Email recepient
SETTINGS[:administrator] = "admin@example.com"
SETTINGS[:failed_report_email_notification] = true
Setting[:administrator] = "admin@example.com"
Setting[:failed_report_email_notification] = true
end
test "when notification fails, if report has an error a mail to admin should be sent" do
......
test "when notification doesn't fails, if report has an error, no mail should be sent" do
setup_for_email_reporting
SETTINGS[:failed_report_email_notification] = false
Setting[:failed_report_email_notification] = false
assert_no_difference 'ActionMailer::Base.deliveries.size' do
Report.import File.read(File.expand_path(File.dirname(__FILE__) + "/../fixtures/report-errors.yaml"))
end

Also available in: Unified diff