Make use of fog_credentials.test.yml for testing.

This commit is contained in:
Guillaume Lazzara 2016-05-20 16:27:32 +02:00
parent 745eee126a
commit d6a3884c81
2 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,10 @@
require_relative 'features'
Fog.credentials_path = Rails.root.join('config/fog_credentials.yml')
if Rails.env.test?
Fog.credentials_path = Rails.root.join('config/fog_credentials.test.yml')
else
Fog.credentials_path = Rails.root.join('config/fog_credentials.yml')
end
CarrierWave.configure do |config|
# These permissions will make dir and files available only to the user running

View file

@ -4,7 +4,7 @@ namespace :dev do
puts 'start initialisation'
Rake::Task['dev:generate_token_file'].invoke
Rake::Task['dev:generate_franceconnect_file'].invoke
Rake::Task['dev:generate_ovh_storage_file'].invoke
Rake::Task['dev:generate_fog_credentials_file'].invoke
Rake::Task['dev:generate_features_file'].invoke
puts 'end initialisation'
@ -38,8 +38,8 @@ EOF
file.close
end
task :generate_ovh_storage_file do
puts 'creating fog_credentials.yml file'
task :generate_fog_credentials_file do
puts 'creating fog_credentials.test.yml file'
content = <<EOF
default:
openstack_tenant: "ovh_fake_tenant_name"
@ -48,7 +48,7 @@ default:
openstack_auth_url: "https://auth.cloud.ovh.net/v2.0/tokens"
openstack_region: "SBG1"
EOF
file = File.new("config/fog_credentials.yml", "w+")
file = File.new("config/fog_credentials.test.yml", "w+")
file.write(content)
file.close
end