Sorry guys the issue was caused by the existing fixtures in my test case. When I removed them the tests are passing.
Anyway there are some inconsistencies in carrierwave wiki. For example setting the credentials directly didn't work for
me when I used just fog.
CarrierWave.configure do |config|
config.fog_credentials = {
provider: 'AWS',
aws_access_key_id: "XXXX",
aws_secret_access_key: "XXXX"
}
config.storage = :fog
config.fog_directory = "xxx-#{Rails.env}"
config.fog_public = true
config.fog_attributes = { 'Cache-Control' => 'max-age=315576000'}
end
I had use use this to make it work.
Fog.credentials_path = Rails.root.join('config/fog_credentials.yml')