Testes para WikiController
This commit is contained in:
@@ -57,6 +57,16 @@ Rails::Initializer.run do |config|
|
||||
# Make Active Record use UTC-base instead of local time
|
||||
config.active_record.default_timezone = :utc
|
||||
|
||||
config.action_view.sanitized_allowed_tags = %W(p h1 h2 h3 h4 h5 h6 dl dt ol
|
||||
ul li address blockquote del div hr ins pre a abbr acronym dfn em strong
|
||||
code samp kbd var b i big small tt span br bdo cite del ins q sub sup img
|
||||
map table tr td th colgroup col caption thead tbody tfoot)
|
||||
|
||||
config.action_view.sanitized_allowed_attributes = %W(align alt border
|
||||
cellpadding cellspacing cols colspan coords height href longdesc name
|
||||
noresize nowrap rel rows rowspan rules scope shape size span src style
|
||||
summary title type usemap valign width)
|
||||
|
||||
config.gem "dr_nic_magic_models"
|
||||
config.gem "bluecloth"
|
||||
config.gem "acts_as_versioned"
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
# Carrega as classes Message e LogEntry. O lazy loading do Rails gera
|
||||
# problemas se voce definir varias classes por arquivos.
|
||||
require "#{RAILS_ROOT}/app/models/message.rb"
|
||||
require "#{RAILS_ROOT}/app/models/log_entry.rb"
|
||||
|
||||
class Fixnum
|
||||
def is_numeric?
|
||||
true
|
||||
@@ -13,6 +8,14 @@ class String
|
||||
def is_numeric?
|
||||
Float self rescue false
|
||||
end
|
||||
|
||||
def html_escape
|
||||
ERB::Util::html_escape(self)
|
||||
end
|
||||
|
||||
%w[auto_link excerpt highlight sanitize simple_format strip_tags truncate word_wrap].each do |method|
|
||||
eval "def #{method}(*args); ActionController::Base.helpers.#{method}(self, *args); end"
|
||||
end
|
||||
end
|
||||
|
||||
class Array
|
||||
@@ -36,9 +39,6 @@ module ActiveRecord
|
||||
module Versioned
|
||||
module ClassMethods
|
||||
def acts_as_paranoid_versioned
|
||||
acts_as_paranoid
|
||||
acts_as_versioned
|
||||
|
||||
# protect the versioned model
|
||||
self.versioned_class.class_eval do
|
||||
def self.delete_all(conditions = nil); return; end
|
||||
@@ -48,3 +48,9 @@ module ActiveRecord
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Carrega as classes Message e LogEntry. O lazy loading do Rails gera
|
||||
# problemas se voce definir varias classes por arquivos.
|
||||
require "#{RAILS_ROOT}/app/models/message.rb"
|
||||
require "#{RAILS_ROOT}/app/models/log_entry.rb"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user