File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 103103 end
104104 end
105105
106+ describe :migrate_with_data do
107+ let ( :env ) { ActiveRecord ::Tasks ::DatabaseTasks . env }
108+
109+ before do
110+ hash_config = ActiveRecord ::DatabaseConfigurations ::HashConfig . new (
111+ env , 'primary' ,
112+ adapter : "sqlite3" ,
113+ database : "spec/db/test.db" ,
114+ migrations_paths : "spec/db/migrate"
115+ )
116+ configurations = ActiveRecord ::DatabaseConfigurations . new ( [ hash_config ] )
117+ allow ( ActiveRecord ::Base ) . to receive ( :configurations ) . and_return ( configurations )
118+ end
119+
120+ it "runs all pending data and schema migrations" do
121+ subject . migrate_with_data
122+
123+ data_versions = DataMigrate ::RailsHelper . data_schema_migration . normalized_versions
124+ expect ( data_versions ) . to include ( "20091231235959" )
125+
126+ schema_versions = DataMigrate ::RailsHelper . schema_migration . normalized_versions
127+ expect ( schema_versions ) . to include ( "20131111111111" )
128+ end
129+ end
130+
106131 describe :prepare_all_with_data do
107132 let ( :db_config ) do
108133 ActiveRecord ::DatabaseConfigurations ::HashConfig . new (
You can’t perform that action at this time.
0 commit comments