aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-04 19:44:17 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-04 19:44:17 -0300
commit57c7d5cb80086e66eee3303b11a5e558aa9e5bf2 (patch)
tree4f414bcd72af62768d07ba01f0791db7aa3b960b /activerecord/test/cases
parent989cccdc3e6f9c6dcb740b2792fcc74b19eed67e (diff)
downloadrails-57c7d5cb80086e66eee3303b11a5e558aa9e5bf2.tar.gz
rails-57c7d5cb80086e66eee3303b11a5e558aa9e5bf2.tar.bz2
rails-57c7d5cb80086e66eee3303b11a5e558aa9e5bf2.zip
Fix the test defining the models in the right place
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/belongs_to_associations_test.rb20
1 files changed, 5 insertions, 15 deletions
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 091c94676e..27f6fa575d 100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
@@ -16,6 +16,8 @@ require 'models/essay'
require 'models/toy'
require 'models/invoice'
require 'models/line_item'
+require 'models/column'
+require 'models/record'
class BelongsToAssociationsTest < ActiveRecord::TestCase
fixtures :accounts, :companies, :developers, :projects, :topics,
@@ -886,21 +888,9 @@ class BelongsToAssociationsTest < ActiveRecord::TestCase
end
end
- test 'belongs_to works with model name Record' do
- Record = Class.new(ActiveRecord::Base) do
- connection.create_table :records
- end
-
- Foo = Class.new(ActiveRecord::Base) do
- connection.create_table :foos do |t|
- t.belongs_to :record
- end
-
- belongs_to :record
- end
-
+ test 'belongs_to works with model called Record' do
record = Record.create!
- Foo.create! record: record
- assert_equal 1, Foo.count
+ Column.create! record: record
+ assert_equal 1, Column.count
end
end