test/test_helper.rb in reform-2.0.5 vs test/test_helper.rb in reform-2.1.0.rc1
- old
+ new
@@ -1,8 +1,9 @@
-require 'reform'
+require "reform"
require 'minitest/autorun'
require "representable/debug"
+require "declarative/testing"
require "pp"
class ReformSpec < MiniTest::Spec
let (:duran) { Struct.new(:name).new("Duran Duran") }
let (:rio) { Struct.new(:title).new("Rio") }
@@ -60,10 +61,14 @@
def saved?
@saved
end
end
+ def self.rails4_2?
+ ::ActiveModel::VERSION::MAJOR == 4 and ::ActiveModel::VERSION::MINOR == 2
+ end
+
def self.rails4_0?
::ActiveModel::VERSION::MAJOR == 4 and ::ActiveModel::VERSION::MINOR == 0
end
def self.rails3_2?
@@ -71,10 +76,14 @@
end
end
require "reform/form/active_model/validations"
Reform::Contract.class_eval do
- include Reform::Form::ActiveModel::Validations
+ feature Reform::Form::ActiveModel::Validations
+end
+# FIXME!
+Reform::Form.class_eval do
+ feature Reform::Form::ActiveModel::Validations
end
I18n.load_path << Dir['test/dummy/config/locales/*.yml']
I18n.backend.load_translations