# Sinatra

cd fixtures/sinatra_test
ln -s "../ashared/models" models
ln -s "../ashared/views/" views
ln -s "../../ashared/migrate" db/migrate
ln -s ../../../../test/integration/posts_controller_test.rb test/functional/posts_controller_test.rb
ln -s ../../../../test/integration/users_controller_test.rb test/functional/users_controller_test.rb

# Padrino

cd fixtures/padrino_test
ln -s "../ashared/models" models
ln -s "../../ashared/views/" app/views
ln -s "../../ashared/migrate" db/migrate
ln -s ../../../../../test/integration/posts_controller_test.rb test/app/controllers/posts_controller_test.rb
ln -s ../../../../../test/integration/users_controller_test.rb test/app/controllers/users_controller_test.rb

# Rails 2

cd fixtures/rails2
ln -s "../../ashared/models" app/models
ln -s "../../ashared/views/" app/views
ln -s "../../ashared/migrate" db/migrate
ln -s ../../../../test/integration/posts_controller_test.rb test/functionals/posts_controller_test.rb
ln -s ../../../../test/integration/users_controller_test.rb test/functionals/users_controller_test.rb

# Rails 3

cd fixtures/rails3
ln -s "../../ashared/models" app/models
ln -s "../../ashared/views/" app/views
ln -s "../../ashared/migrate" db/migrate
ln -s ../../../../test/integration/posts_controller_test.rb test/functional/posts_controller_test.rb
ln -s ../../../../test/integration/users_controller_test.rb test/functional/users_controller_test.rb

# Rails 3.2

cd fixtures/rails3_2
ln -s "../../ashared/models" app/models
ln -s "../../ashared/views_rails_3/" app/views
ln -s "../../ashared/migrate" db/migrate
ln -s ../../../../test/integration/rails3_2/posts_controller_test.rb test/functional/posts_controller_test.rb
ln -s ../../../../test/integration/rails3_2/users_controller_test.rb test/functional/users_controller_test.rb

# Rails 5

cd fixtures/rails5
ln -s "../../ashared/models" app/models
ln -s "../../ashared/views_rails_3/" app/views
ln -s "../../ashared/migrate" db/migrate
ln -s "../../ashared/helpers" app/helpers
ln -s "../../../ashared/controllers_rails_5/posts_controller.rb" app/controllers/posts_controller.rb
ln -s "../../../ashared/controllers_rails_5/users_controller.rb" app/controllers/users_controller.rb
ln -s ../../../../test/integration/rails5/posts_controller_test.rb test/functional/posts_controller_test.rb
ln -s ../../../../test/integration/rails5/users_controller_test.rb test/functional/users_controller_test.rb
echo "Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1" >> config/initializers/mime_types.rb
# Do route file?

# Rails 5 API mode

# Basic setup
cd fixtures
rvm use 2.5.0
rails _5.0.2_ new rails5_api --api
cd rails5_api

# Server config
echo "Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1" >> config/initializers/mime_types.rb
cp ../rails5/config/routes.rb config/routes.rb

# Application
rm -r app/models app/views app/migrate
ln -s "../../ashared/models" app/models
ln -s "../../ashared/views_rails_3/" app/views
ln -s "../../ashared/migrate" db/migrate
ln -s "../../ashared/helpers" app/helpers
ln -s "../../../ashared/controllers_rails_5/posts_controller.rb" app/controllers/posts_controller.rb
ln -s "../../../ashared/controllers_rails_5/users_controller.rb" app/controllers/users_controller.rb

# Test setup
cp ../rails5/Rakefile ./
mkdir test/functional
ln -s ../../../../test/integration/rails5/posts_controller_test.rb test/functional/posts_controller_test.rb
ln -s ../../../../test/integration/rails5/users_controller_test.rb test/functional/users_controller_test.rb
cp ../rails5/test/test_helper.rb ./test/test_helper.rb

# Do a bunch of junk with gemfiles and test helpers and such

# end Rails 5 API mode

# Rails 6

cd fixtures/rails6
ln -s "../../ashared/models" app/models
ln -s "../../ashared/views_rails_6/" app/views
ln -s "../../ashared/helpers" app/helpers
ln -s ../../../../test/integration/rails6/posts_controller_test.rb test/functional/posts_controller_test.rb
ln -s ../../../../test/integration/rails6/users_controller_test.rb test/functional/users_controller_test.rb
echo "Mime::Type.register 'application/vnd.rabl-test_v1+json', :rabl_test_v1" >> config/initializers/mime_types.rb
