Skip to content

Commit

Permalink
Rename tests to reflect associations
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltrix committed Jun 13, 2011
1 parent 00c12ff commit 113466c
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions activerecord/test/cases/mass_assignment_security_test.rb
Expand Up @@ -384,81 +384,81 @@ class MassAssignmentSecurityBelongsToRelationsTest < ActiveRecord::TestCase

# build

def test_has_one_build_with_attr_protected_attributes
def test_belongs_to_build_with_attr_protected_attributes
best_friend = @person.build_best_friend_of(attributes_hash)
assert_default_attributes(best_friend)
end

def test_has_one_build_with_attr_accessible_attributes
def test_belongs_to_build_with_attr_accessible_attributes
best_friend = @person.build_best_friend_of(attributes_hash)
assert_default_attributes(best_friend)
end

def test_has_one_build_with_admin_role_with_attr_protected_attributes
def test_belongs_to_build_with_admin_role_with_attr_protected_attributes
best_friend = @person.build_best_friend_of(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend)
end

def test_has_one_build_with_admin_role_with_attr_accessible_attributes
def test_belongs_to_build_with_admin_role_with_attr_accessible_attributes
best_friend = @person.build_best_friend_of(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend)
end

def test_has_one_build_without_protection
def test_belongs_to_build_without_protection
best_friend = @person.build_best_friend_of(attributes_hash, :without_protection => true)
assert_all_attributes(best_friend)
end

# create

def test_has_one_create_with_attr_protected_attributes
def test_belongs_to_create_with_attr_protected_attributes
best_friend = @person.create_best_friend_of(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_attr_accessible_attributes
def test_belongs_to_create_with_attr_accessible_attributes
best_friend = @person.create_best_friend_of(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_admin_role_with_attr_protected_attributes
def test_belongs_to_create_with_admin_role_with_attr_protected_attributes
best_friend = @person.create_best_friend_of(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_with_admin_role_with_attr_accessible_attributes
def test_belongs_to_create_with_admin_role_with_attr_accessible_attributes
best_friend = @person.create_best_friend_of(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_without_protection
def test_belongs_to_create_without_protection
best_friend = @person.create_best_friend_of(attributes_hash, :without_protection => true)
assert_all_attributes(best_friend)
end

# create!

def test_has_one_create_with_bang_with_attr_protected_attributes
def test_belongs_to_create_with_bang_with_attr_protected_attributes
best_friend = @person.create_best_friend!(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_bang_with_attr_accessible_attributes
def test_belongs_to_create_with_bang_with_attr_accessible_attributes
best_friend = @person.create_best_friend!(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_bang_with_admin_role_with_attr_protected_attributes
def test_belongs_to_create_with_bang_with_admin_role_with_attr_protected_attributes
best_friend = @person.create_best_friend!(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_with_bang_with_admin_role_with_attr_accessible_attributes
def test_belongs_to_create_with_bang_with_admin_role_with_attr_accessible_attributes
best_friend = @person.create_best_friend!(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_with_bang_without_protection
def test_belongs_to_create_with_bang_without_protection
best_friend = @person.create_best_friend!(attributes_hash, :without_protection => true)
assert_all_attributes(best_friend)
end
Expand All @@ -472,81 +472,81 @@ class MassAssignmentSecurityHasManyRelationsTest < ActiveRecord::TestCase

# build

def test_has_one_build_with_attr_protected_attributes
def test_has_many_build_with_attr_protected_attributes
best_friend = @person.best_friends.build(attributes_hash)
assert_default_attributes(best_friend)
end

def test_has_one_build_with_attr_accessible_attributes
def test_has_many_build_with_attr_accessible_attributes
best_friend = @person.best_friends.build(attributes_hash)
assert_default_attributes(best_friend)
end

def test_has_one_build_with_admin_role_with_attr_protected_attributes
def test_has_many_build_with_admin_role_with_attr_protected_attributes
best_friend = @person.best_friends.build(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend)
end

def test_has_one_build_with_admin_role_with_attr_accessible_attributes
def test_has_many_build_with_admin_role_with_attr_accessible_attributes
best_friend = @person.best_friends.build(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend)
end

def test_has_one_build_without_protection
def test_has_many_build_without_protection
best_friend = @person.best_friends.build(attributes_hash, :without_protection => true)
assert_all_attributes(best_friend)
end

# create

def test_has_one_create_with_attr_protected_attributes
def test_has_many_create_with_attr_protected_attributes
best_friend = @person.best_friends.create(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_attr_accessible_attributes
def test_has_many_create_with_attr_accessible_attributes
best_friend = @person.best_friends.create(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_admin_role_with_attr_protected_attributes
def test_has_many_create_with_admin_role_with_attr_protected_attributes
best_friend = @person.best_friends.create(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_with_admin_role_with_attr_accessible_attributes
def test_has_many_create_with_admin_role_with_attr_accessible_attributes
best_friend = @person.best_friends.create(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_without_protection
def test_has_many_create_without_protection
best_friend = @person.best_friends.create(attributes_hash, :without_protection => true)
assert_all_attributes(best_friend)
end

# create!

def test_has_one_create_with_bang_with_attr_protected_attributes
def test_has_many_create_with_bang_with_attr_protected_attributes
best_friend = @person.best_friends.create!(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_bang_with_attr_accessible_attributes
def test_has_many_create_with_bang_with_attr_accessible_attributes
best_friend = @person.best_friends.create!(attributes_hash)
assert_default_attributes(best_friend, true)
end

def test_has_one_create_with_bang_with_admin_role_with_attr_protected_attributes
def test_has_many_create_with_bang_with_admin_role_with_attr_protected_attributes
best_friend = @person.best_friends.create!(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_with_bang_with_admin_role_with_attr_accessible_attributes
def test_has_many_create_with_bang_with_admin_role_with_attr_accessible_attributes
best_friend = @person.best_friends.create!(attributes_hash, :as => :admin)
assert_admin_attributes(best_friend, true)
end

def test_has_one_create_with_bang_without_protection
def test_has_many_create_with_bang_without_protection
best_friend = @person.best_friends.create!(attributes_hash, :without_protection => true)
assert_all_attributes(best_friend)
end
Expand Down

0 comments on commit 113466c

Please sign in to comment.