Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Test for #489

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@434 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 8b82c5042dbd8bb8b15b0ca4ac915ee5e1547879 1 parent 1ae630a
@dhh dhh authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 activerecord/test/associations_test.rb
View
9 activerecord/test/associations_test.rb
@@ -487,8 +487,10 @@ def test_adding_array_and_collection
end
class BelongsToAssociationsTest < Test::Unit::TestCase
+ fixtures :accounts, :companies, :developers, :projects, :topics
+
def setup
- create_fixtures "accounts", "companies", "developers", "projects", "developers_projects", "topics"
+ create_fixtures "developers_projects"
@signals37 = Firm.find(1)
end
@@ -577,6 +579,11 @@ def test_assignment_before_either_saved
assert_equal apple, final_cut.firm(true)
end
+ def test_new_record_with_foreign_key_but_no_object
+ c = Client.new("firm_id" => 1)
+ assert_equal @first_firm, c.firm_with_basic_id
+ end
+
def test_field_name_same_as_foreign_key
computer = Computer.find 1
assert_not_nil computer.developer, ":foreign key == attribute didn't lock up"
Please sign in to comment.
Something went wrong with that request. Please try again.