Commit f9a9fc5b authored by jplang's avatar jplang

Test failures with sqlite3.

git-svn-id: https://svn.redmine.org/redmine/trunk@17502 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent eb640bad
......@@ -4874,6 +4874,7 @@ class IssuesControllerTest < Redmine::ControllerTest
# Delete all fixtured journals, a race condition can occur causing the wrong
# journal to get fetched in the next find.
Journal.delete_all
JournalDetail.delete_all
with_settings :notified_events => %w(issue_updated) do
# anonymous user
......@@ -5469,7 +5470,7 @@ class IssuesControllerTest < Redmine::ControllerTest
end
def test_bulk_edit_should_warn_about_custom_field_values_about_to_be_cleared
CustomField.delete_all
CustomField.destroy_all
cleared = IssueCustomField.generate!(:name => 'Cleared', :tracker_ids => [2], :is_for_all => true)
CustomValue.create!(:customized => Issue.find(2), :custom_field => cleared, :value => 'foo')
......
......@@ -32,8 +32,9 @@ class IssuesCustomFieldsVisibilityTest < Redmine::ControllerTest
:workflows
def setup
CustomField.delete_all
CustomField.destroy_all
Issue.delete_all
field_attributes = {:field_format => 'string', :is_for_all => true, :is_filter => true, :trackers => Tracker.all}
@fields = []
@fields << (@field1 = IssueCustomField.create!(field_attributes.merge(:name => 'Field 1', :visible => true)))
......@@ -220,7 +221,9 @@ class IssuesCustomFieldsVisibilityTest < Redmine::ControllerTest
end
def test_index_with_partial_custom_field_visibility
CustomValue.delete_all
Issue.delete_all
p1 = Project.generate!
p2 = Project.generate!
user = User.generate!
......
......@@ -162,6 +162,7 @@ class EnumerationTest < ActiveSupport::TestCase
def test_destroying_override_should_not_update_positions
Enumeration.delete_all
Issue.delete_all
a = IssuePriority.create!(:name => 'A')
b = IssuePriority.create!(:name => 'B')
......
......@@ -1103,7 +1103,7 @@ class IssueTest < ActiveSupport::TestCase
end
def test_required_custom_field_that_is_not_visible_for_the_user_should_not_be_required
CustomField.delete_all
CustomField.destroy_all
field = IssueCustomField.generate!(:is_required => true, :visible => false, :role_ids => [1], :trackers => Tracker.all, :is_for_all => true)
user = User.generate!
User.add_to_project(user, Project.find(1), Role.find(2))
......@@ -1114,7 +1114,7 @@ class IssueTest < ActiveSupport::TestCase
end
def test_required_custom_field_that_is_visible_for_the_user_should_be_required
CustomField.delete_all
CustomField.destroy_all
field = IssueCustomField.generate!(:is_required => true, :visible => false, :role_ids => [1], :trackers => Tracker.all, :is_for_all => true)
user = User.generate!
User.add_to_project(user, Project.find(1), Role.find(1))
......
......@@ -149,7 +149,7 @@ class ProjectCopyTest < ActiveSupport::TestCase
def test_copy_issues_should_reassign_version_custom_fields_to_copied_versions
User.current = User.find(1)
CustomField.delete_all
CustomField.destroy_all
field = IssueCustomField.generate!(:field_format => 'version', :is_for_all => true, :trackers => Tracker.all)
source_project = Project.generate!(:trackers => Tracker.all)
source_version = Version.generate!(:project => source_project)
......
......@@ -315,15 +315,13 @@ class ProjectTest < ActiveSupport::TestCase
end
def test_set_parent_should_add_roots_in_alphabetical_order
ProjectCustomField.delete_all
Project.delete_all
Project.create!(:name => 'Project C', :identifier => 'project-c').set_parent!(nil)
Project.create!(:name => 'Project B', :identifier => 'project-b').set_parent!(nil)
Project.create!(:name => 'Project D', :identifier => 'project-d').set_parent!(nil)
Project.create!(:name => 'Project A', :identifier => 'project-a').set_parent!(nil)
assert_equal 4, Project.count
assert_equal Project.all.sort_by(&:name), Project.all.sort_by(&:lft)
projects = new_records(Project, 4) do
Project.create!(:name => 'Project C', :identifier => 'project-c').set_parent!(nil)
Project.create!(:name => 'Project B', :identifier => 'project-b').set_parent!(nil)
Project.create!(:name => 'Project D', :identifier => 'project-d').set_parent!(nil)
Project.create!(:name => 'Project A', :identifier => 'project-a').set_parent!(nil)
end
assert_equal projects.sort_by(&:name), projects.sort_by(&:lft)
end
def test_set_parent_should_add_children_in_alphabetical_order
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment