Skip to content
This repository
Browse code

Rename tests to reflect associations

  • Loading branch information...
commit 113466cd94c6399f4fe6b0e8dc26e10d0c6b1b30 1 parent 00c12ff
Andrew White pixeltrix authored

Showing 1 changed file with 30 additions and 30 deletions. Show diff stats Hide diff stats

  1. +30 30 activerecord/test/cases/mass_assignment_security_test.rb
60 activerecord/test/cases/mass_assignment_security_test.rb
@@ -384,81 +384,81 @@ class MassAssignmentSecurityBelongsToRelationsTest < ActiveRecord::TestCase
384 384
385 385 # build
386 386
387   - def test_has_one_build_with_attr_protected_attributes
  387 + def test_belongs_to_build_with_attr_protected_attributes
388 388 best_friend = @person.build_best_friend_of(attributes_hash)
389 389 assert_default_attributes(best_friend)
390 390 end
391 391
392   - def test_has_one_build_with_attr_accessible_attributes
  392 + def test_belongs_to_build_with_attr_accessible_attributes
393 393 best_friend = @person.build_best_friend_of(attributes_hash)
394 394 assert_default_attributes(best_friend)
395 395 end
396 396
397   - def test_has_one_build_with_admin_role_with_attr_protected_attributes
  397 + def test_belongs_to_build_with_admin_role_with_attr_protected_attributes
398 398 best_friend = @person.build_best_friend_of(attributes_hash, :as => :admin)
399 399 assert_admin_attributes(best_friend)
400 400 end
401 401
402   - def test_has_one_build_with_admin_role_with_attr_accessible_attributes
  402 + def test_belongs_to_build_with_admin_role_with_attr_accessible_attributes
403 403 best_friend = @person.build_best_friend_of(attributes_hash, :as => :admin)
404 404 assert_admin_attributes(best_friend)
405 405 end
406 406
407   - def test_has_one_build_without_protection
  407 + def test_belongs_to_build_without_protection
408 408 best_friend = @person.build_best_friend_of(attributes_hash, :without_protection => true)
409 409 assert_all_attributes(best_friend)
410 410 end
411 411
412 412 # create
413 413
414   - def test_has_one_create_with_attr_protected_attributes
  414 + def test_belongs_to_create_with_attr_protected_attributes
415 415 best_friend = @person.create_best_friend_of(attributes_hash)
416 416 assert_default_attributes(best_friend, true)
417 417 end
418 418
419   - def test_has_one_create_with_attr_accessible_attributes
  419 + def test_belongs_to_create_with_attr_accessible_attributes
420 420 best_friend = @person.create_best_friend_of(attributes_hash)
421 421 assert_default_attributes(best_friend, true)
422 422 end
423 423
424   - def test_has_one_create_with_admin_role_with_attr_protected_attributes
  424 + def test_belongs_to_create_with_admin_role_with_attr_protected_attributes
425 425 best_friend = @person.create_best_friend_of(attributes_hash, :as => :admin)
426 426 assert_admin_attributes(best_friend, true)
427 427 end
428 428
429   - def test_has_one_create_with_admin_role_with_attr_accessible_attributes
  429 + def test_belongs_to_create_with_admin_role_with_attr_accessible_attributes
430 430 best_friend = @person.create_best_friend_of(attributes_hash, :as => :admin)
431 431 assert_admin_attributes(best_friend, true)
432 432 end
433 433
434   - def test_has_one_create_without_protection
  434 + def test_belongs_to_create_without_protection
435 435 best_friend = @person.create_best_friend_of(attributes_hash, :without_protection => true)
436 436 assert_all_attributes(best_friend)
437 437 end
438 438
439 439 # create!
440 440
441   - def test_has_one_create_with_bang_with_attr_protected_attributes
  441 + def test_belongs_to_create_with_bang_with_attr_protected_attributes
442 442 best_friend = @person.create_best_friend!(attributes_hash)
443 443 assert_default_attributes(best_friend, true)
444 444 end
445 445
446   - def test_has_one_create_with_bang_with_attr_accessible_attributes
  446 + def test_belongs_to_create_with_bang_with_attr_accessible_attributes
447 447 best_friend = @person.create_best_friend!(attributes_hash)
448 448 assert_default_attributes(best_friend, true)
449 449 end
450 450
451   - def test_has_one_create_with_bang_with_admin_role_with_attr_protected_attributes
  451 + def test_belongs_to_create_with_bang_with_admin_role_with_attr_protected_attributes
452 452 best_friend = @person.create_best_friend!(attributes_hash, :as => :admin)
453 453 assert_admin_attributes(best_friend, true)
454 454 end
455 455
456   - def test_has_one_create_with_bang_with_admin_role_with_attr_accessible_attributes
  456 + def test_belongs_to_create_with_bang_with_admin_role_with_attr_accessible_attributes
457 457 best_friend = @person.create_best_friend!(attributes_hash, :as => :admin)
458 458 assert_admin_attributes(best_friend, true)
459 459 end
460 460
461   - def test_has_one_create_with_bang_without_protection
  461 + def test_belongs_to_create_with_bang_without_protection
462 462 best_friend = @person.create_best_friend!(attributes_hash, :without_protection => true)
463 463 assert_all_attributes(best_friend)
464 464 end
@@ -472,81 +472,81 @@ class MassAssignmentSecurityHasManyRelationsTest < ActiveRecord::TestCase
472 472
473 473 # build
474 474
475   - def test_has_one_build_with_attr_protected_attributes
  475 + def test_has_many_build_with_attr_protected_attributes
476 476 best_friend = @person.best_friends.build(attributes_hash)
477 477 assert_default_attributes(best_friend)
478 478 end
479 479
480   - def test_has_one_build_with_attr_accessible_attributes
  480 + def test_has_many_build_with_attr_accessible_attributes
481 481 best_friend = @person.best_friends.build(attributes_hash)
482 482 assert_default_attributes(best_friend)
483 483 end
484 484
485   - def test_has_one_build_with_admin_role_with_attr_protected_attributes
  485 + def test_has_many_build_with_admin_role_with_attr_protected_attributes
486 486 best_friend = @person.best_friends.build(attributes_hash, :as => :admin)
487 487 assert_admin_attributes(best_friend)
488 488 end
489 489
490   - def test_has_one_build_with_admin_role_with_attr_accessible_attributes
  490 + def test_has_many_build_with_admin_role_with_attr_accessible_attributes
491 491 best_friend = @person.best_friends.build(attributes_hash, :as => :admin)
492 492 assert_admin_attributes(best_friend)
493 493 end
494 494
495   - def test_has_one_build_without_protection
  495 + def test_has_many_build_without_protection
496 496 best_friend = @person.best_friends.build(attributes_hash, :without_protection => true)
497 497 assert_all_attributes(best_friend)
498 498 end
499 499
500 500 # create
501 501
502   - def test_has_one_create_with_attr_protected_attributes
  502 + def test_has_many_create_with_attr_protected_attributes
503 503 best_friend = @person.best_friends.create(attributes_hash)
504 504 assert_default_attributes(best_friend, true)
505 505 end
506 506
507   - def test_has_one_create_with_attr_accessible_attributes
  507 + def test_has_many_create_with_attr_accessible_attributes
508 508 best_friend = @person.best_friends.create(attributes_hash)
509 509 assert_default_attributes(best_friend, true)
510 510 end
511 511
512   - def test_has_one_create_with_admin_role_with_attr_protected_attributes
  512 + def test_has_many_create_with_admin_role_with_attr_protected_attributes
513 513 best_friend = @person.best_friends.create(attributes_hash, :as => :admin)
514 514 assert_admin_attributes(best_friend, true)
515 515 end
516 516
517   - def test_has_one_create_with_admin_role_with_attr_accessible_attributes
  517 + def test_has_many_create_with_admin_role_with_attr_accessible_attributes
518 518 best_friend = @person.best_friends.create(attributes_hash, :as => :admin)
519 519 assert_admin_attributes(best_friend, true)
520 520 end
521 521
522   - def test_has_one_create_without_protection
  522 + def test_has_many_create_without_protection
523 523 best_friend = @person.best_friends.create(attributes_hash, :without_protection => true)
524 524 assert_all_attributes(best_friend)
525 525 end
526 526
527 527 # create!
528 528
529   - def test_has_one_create_with_bang_with_attr_protected_attributes
  529 + def test_has_many_create_with_bang_with_attr_protected_attributes
530 530 best_friend = @person.best_friends.create!(attributes_hash)
531 531 assert_default_attributes(best_friend, true)
532 532 end
533 533
534   - def test_has_one_create_with_bang_with_attr_accessible_attributes
  534 + def test_has_many_create_with_bang_with_attr_accessible_attributes
535 535 best_friend = @person.best_friends.create!(attributes_hash)
536 536 assert_default_attributes(best_friend, true)
537 537 end
538 538
539   - def test_has_one_create_with_bang_with_admin_role_with_attr_protected_attributes
  539 + def test_has_many_create_with_bang_with_admin_role_with_attr_protected_attributes
540 540 best_friend = @person.best_friends.create!(attributes_hash, :as => :admin)
541 541 assert_admin_attributes(best_friend, true)
542 542 end
543 543
544   - def test_has_one_create_with_bang_with_admin_role_with_attr_accessible_attributes
  544 + def test_has_many_create_with_bang_with_admin_role_with_attr_accessible_attributes
545 545 best_friend = @person.best_friends.create!(attributes_hash, :as => :admin)
546 546 assert_admin_attributes(best_friend, true)
547 547 end
548 548
549   - def test_has_one_create_with_bang_without_protection
  549 + def test_has_many_create_with_bang_without_protection
550 550 best_friend = @person.best_friends.create!(attributes_hash, :without_protection => true)
551 551 assert_all_attributes(best_friend)
552 552 end

0 comments on commit 113466c

Please sign in to comment.
Something went wrong with that request. Please try again.