Project

General

Profile

« Previous | Next » 

Revision 12071

Added by Toshi MARUYAMA almost 12 years ago

Merged r12070 from trunk to 2.3-stable

not use assert_not_nil in Errors#[].

r7593 etc. replaced Rails2 Errors#on.
Rails3 Errors#[] always return array.
So, Rails3 Errors#[] is always not nil.

View differences:

branches/2.3-stable/test/functional/projects_controller_test.rb
209 209
    assert_response :success
210 210
    project = assigns(:project)
211 211
    assert_kind_of Project, project
212
    assert_not_nil project.errors[:parent_id]
212
    assert_not_equal [], project.errors[:parent_id]
213 213
  end
214 214

  
215 215
  test "#create by non-admin user with add_subprojects permission should create a project with a parent_id" do
......
244 244
    assert_response :success
245 245
    project = assigns(:project)
246 246
    assert_kind_of Project, project
247
    assert_not_nil project.errors[:parent_id]
247
    assert_not_equal [], project.errors[:parent_id]
248 248
  end
249 249

  
250 250
  test "#create by non-admin user with add_subprojects permission should fail with unauthorized parent_id" do
......
265 265
    assert_response :success
266 266
    project = assigns(:project)
267 267
    assert_kind_of Project, project
268
    assert_not_nil project.errors[:parent_id]
268
    assert_not_equal [], project.errors[:parent_id]
269 269
  end
270 270

  
271 271
  def test_create_subproject_with_inherit_members_should_inherit_members
branches/2.3-stable/test/unit/attachment_test.rb
93 93
  def test_description_length_should_be_validated
94 94
    a = Attachment.new(:description => 'a' * 300)
95 95
    assert !a.save
96
    assert_not_nil a.errors[:description]
96
    assert_not_equal [], a.errors[:description]
97 97
  end
98 98

  
99 99
  def test_destroy
branches/2.3-stable/test/unit/issue_nested_set_test.rb
57 57
    child = Issue.new(:project_id => 2, :tracker_id => 1, :author_id => 1,
58 58
                      :subject => 'child', :parent_issue_id => issue.id)
59 59
    assert !child.save
60
    assert_not_nil child.errors[:parent_issue_id]
60
    assert_not_equal [], child.errors[:parent_issue_id]
61 61
  end
62 62

  
63 63
  def test_move_a_root_to_child
......
163 163
    child.reload
164 164
    child.parent_issue_id = grandchild.id
165 165
    assert !child.save
166
    assert_not_nil child.errors[:parent_issue_id]
166
    assert_not_equal [], child.errors[:parent_issue_id]
167 167
  end
168 168

  
169 169
  def test_destroy_should_destroy_children
branches/2.3-stable/test/unit/issue_relation_test.rb
114 114
          :relation_type => IssueRelation::TYPE_PRECEDES
115 115
        )
116 116
    assert !r.save
117
    assert_not_nil r.errors[:base]
117
    assert_not_equal [], r.errors[:base]
118 118
  end
119 119

  
120 120
  def test_validates_circular_dependency_of_subtask
......
165 165
          :relation_type => IssueRelation::TYPE_BLOCKED
166 166
        )
167 167
    assert !r.save
168
    assert_not_nil r.errors[:base]
168
    assert_not_equal [], r.errors[:base]
169 169
  end
170 170
end
branches/2.3-stable/test/unit/issue_test.rb
469 469
    issue.tracker_id = 2
470 470
    issue.subject = 'New subject'
471 471
    assert !issue.save
472
    assert_not_nil issue.errors[:tracker_id]
472
    assert_not_equal [], issue.errors[:tracker_id]
473 473
  end
474 474

  
475 475
  def test_category_based_assignment
......
1024 1024
                      :status_id => 1, :fixed_version_id => 1,
1025 1025
                      :subject => 'New issue')
1026 1026
    assert !issue.save
1027
    assert_not_nil issue.errors[:fixed_version_id]
1027
    assert_not_equal [], issue.errors[:fixed_version_id]
1028 1028
  end
1029 1029

  
1030 1030
  def test_should_not_be_able_to_assign_a_new_issue_to_a_locked_version
......
1032 1032
                      :status_id => 1, :fixed_version_id => 2,
1033 1033
                      :subject => 'New issue')
1034 1034
    assert !issue.save
1035
    assert_not_nil issue.errors[:fixed_version_id]
1035
    assert_not_equal [], issue.errors[:fixed_version_id]
1036 1036
  end
1037 1037

  
1038 1038
  def test_should_be_able_to_assign_a_new_issue_to_an_open_version
......
1053 1053
    issue = Issue.find(11)
1054 1054
    issue.status_id = 1
1055 1055
    assert !issue.save
1056
    assert_not_nil issue.errors[:base]
1056
    assert_not_equal [], issue.errors[:base]
1057 1057
  end
1058 1058

  
1059 1059
  def test_should_be_able_to_reopen_and_reassign_an_issue_assigned_to_a_closed_version
branches/2.3-stable/test/unit/user_test.rb
366 366
    u = User.new
367 367
    u.mail_notification = 'foo'
368 368
    u.save
369
    assert_not_nil u.errors[:mail_notification]
369
    assert_not_equal [], u.errors[:mail_notification]
370 370
  end
371 371

  
372 372
  context "User#try_to_login" do

Also available in: Unified diff