Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix brittle rails 3.0 test/mocking

  • Loading branch information...
commit a109c12452513339b39debf1b1b89b46936363a2 1 parent e2cd5b1
@jenseng authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 test/immigrant_test.rb
View
8 test/immigrant_test.rb
@@ -20,7 +20,7 @@ def supports_primary_key? # AR <3.2
true
end
def primary_key(table)
- table !~ /s_.*s\z/ ? 'id' : nil
+ table.to_s !~ /s_.*s\z/ ? 'id' : nil
end
end
@@ -143,7 +143,7 @@ class Fan < MockModel; end
test 'has_and_belongs_to_many should respect the join_table' do
class Author < MockModel
- has_and_belongs_to_many :fans, :join_table => :lol_wuts
+ has_and_belongs_to_many :fans, :join_table => :lols_wuts
end
class Fan < MockModel; end
@@ -151,11 +151,11 @@ class Fan < MockModel; end
assert_nothing_raised { keys.map { |key| key.to_ruby(:add) } }
assert_equal(
[foreign_key_definition(
- 'lol_wuts', 'authors',
+ 'lols_wuts', 'authors',
:column => 'author_id', :primary_key => 'id', :dependent => nil
),
foreign_key_definition(
- 'lol_wuts', 'fans',
+ 'lols_wuts', 'fans',
:column => 'fan_id', :primary_key => 'id', :dependent => nil
)],
keys
Please sign in to comment.
Something went wrong with that request. Please try again.