Module: Workarea::TestCase::S3
- Extended by:
- ActiveSupport::Concern
- Included in:
- IntegrationTest, MailerTest, PerformanceTest, SystemTest, Workarea::TestCase
- Defined in:
- lib/workarea/test_case.rb
Instance Method Summary collapse
Instance Method Details
#mock_s3 ⇒ Object
165 166 167 168 169 170 |
# File 'lib/workarea/test_case.rb', line 165 def mock_s3 Fog.mock! Workarea.s3.directories.create(key: Workarea::Configuration::S3.bucket) Workarea.s3.stubs(:get_bucket_cors).returns(mock_s3_cors_response) Workarea.s3.stubs(:put_bucket_cors) end |
#mock_s3_cors_response ⇒ Object
176 177 178 179 180 |
# File 'lib/workarea/test_case.rb', line 176 def mock_s3_cors_response result = mock('Excon::Response') result.stubs(data: { body: { 'CORSConfiguration' => [] } }) result end |
#reset_s3 ⇒ Object
172 173 174 |
# File 'lib/workarea/test_case.rb', line 172 def reset_s3 Fog::Mock.reset end |