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
168 169 170 171 172 173 |
# File 'lib/workarea/test_case.rb', line 168 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
179 180 181 182 183 |
# File 'lib/workarea/test_case.rb', line 179 def mock_s3_cors_response result = mock('Excon::Response') result.stubs(data: { body: { 'CORSConfiguration' => [] } }) result end |
#reset_s3 ⇒ Object
175 176 177 |
# File 'lib/workarea/test_case.rb', line 175 def reset_s3 Fog::Mock.reset end |