Skip to content

Commit

Permalink
Add schema_search_path to test database.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
teeparham committed May 16, 2014
1 parent 05c553f commit c98c33d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions test/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ host: 127.0.0.1
database: postgis_adapter_test
username: postgres
setup: default
schema_search_path: public
10 changes: 5 additions & 5 deletions test/tasks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_empty_sql_dump
filename = ::File.expand_path('../tmp/tmp.sql', ::File.dirname(__FILE__))
::FileUtils.rm_f(filename)
::FileUtils.mkdir_p(::File.dirname(filename))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config.merge('schema_search_path' => 'public'))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config)
::ActiveRecord::Tasks::DatabaseTasks.structure_dump(TasksTest.new_database_config, filename)
sql = ::File.read(filename)
assert(sql !~ /CREATE TABLE/)
Expand All @@ -45,7 +45,7 @@ def test_basic_geography_sql_dump
filename = ::File.expand_path('../tmp/tmp.sql', ::File.dirname(__FILE__))
::FileUtils.rm_f(filename)
::FileUtils.mkdir_p(::File.dirname(filename))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config.merge('schema_search_path' => 'public'))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config)
::ActiveRecord::Base.connection.create_table(:spatial_test) do |t|
t.point "latlon", :geographic => true
end
Expand All @@ -58,7 +58,7 @@ def test_empty_schema_dump
filename = ::File.expand_path('../tmp/tmp.rb', ::File.dirname(__FILE__))
::FileUtils.rm_f(filename)
::FileUtils.mkdir_p(::File.dirname(filename))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config.merge('schema_search_path' => 'public'))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config)
::File.open(filename, "w:utf-8") do |file|
::ActiveRecord::SchemaDumper.dump(::ActiveRecord::Base.connection, file)
end
Expand All @@ -70,7 +70,7 @@ def test_basic_geometry_schema_dump
filename = ::File.expand_path('../tmp/tmp.rb', ::File.dirname(__FILE__))
::FileUtils.rm_f(filename)
::FileUtils.mkdir_p(::File.dirname(filename))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config.merge('schema_search_path' => 'public'))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config)
conn = ::ActiveRecord::Base.connection
conn.create_table(:spatial_test) do |t|
t.geometry 'object1'
Expand All @@ -88,7 +88,7 @@ def test_basic_geography_schema_dump
filename = ::File.expand_path('../tmp/tmp.rb', ::File.dirname(__FILE__))
::FileUtils.rm_f(filename)
::FileUtils.mkdir_p(::File.dirname(filename))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config.merge('schema_search_path' => 'public'))
::ActiveRecord::Tasks::DatabaseTasks.create(TasksTest.new_database_config)
conn = ::ActiveRecord::Base.connection
conn.create_table(:spatial_test) do |t|
t.point "latlon1", :geographic => true
Expand Down

0 comments on commit c98c33d

Please sign in to comment.