Sha256: 8c707a93634b592780b949d8660fd3ba4d3cc9c39ce33793e25d6e12d56cff7e
Contents?: true
Size: 722 Bytes
Versions: 17
Compression:
Stored size: 722 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "Foreign Key definition" do before(:all) do load_core_schema end let(:definition) { SchemaPlus::ActiveRecord::ConnectionAdapters::ForeignKeyDefinition.new("posts_user_fkey", :posts, :user, :users, :id) } it "it is dumped to sql with quoted values" do definition.to_sql.should == %Q{CONSTRAINT posts_user_fkey FOREIGN KEY (#{quote_column_name('user')}) REFERENCES #{quote_table_name('users')} (#{quote_column_name('id')})} end def quote_table_name(table) ActiveRecord::Base.connection.quote_table_name(table) end def quote_column_name(column) ActiveRecord::Base.connection.quote_column_name(column) end end
Version data entries
17 entries across 17 versions & 1 rubygems