test/qv_entity.rb in qooxview-1.9.10 vs test/qv_entity.rb in qooxview-1.9.11
- old
+ new
@@ -126,11 +126,12 @@
@base_1011.teacher.pass = 'super111'
assert_equal 'super111', @base_1011.teacher.pass
assert_equal 'super111', @admin.pass
end
- def test_speed_persons
+ # No perftools for ruby 2.4
+ def tes_speed_persons
require 'rubygems'
require 'perftools'
PerfTools::CpuProfiler.start('/tmp/profile') do
(1..400).each { |p|
dputs(1) { "Creating person #{p}" }
@@ -265,7 +266,24 @@
Entities.save_all
Entities.delete_all_data(true)
assert_equal(nil, Courses.static._test)
Entities.load_all
assert_equal(1, Courses.static._test)
+ end
+
+ def test_init
+ Entities.delete_all_data
+ assert_equal 0, InitTests.search_all.count
+ Entities.load_all
+ its = InitTests.search_all
+ assert_equal 1, its.count
+ assert_equal 'howdy', its.first.text
+ assert_equal 1, MigrationVersions.find_by_class_name('InitTest').version
+
+ Entities.delete_all_data
+ assert_equal 0, InitTests.search_all.count
+ InitTests.class_eval { undef :init }
+ Entities.load_all
+ assert_equal 0, InitTests.search_all.count
+ assert_equal 1, MigrationVersions.find_by_class_name('InitTest').version
end
end