Sha256: 01e15391073e5408eee19b46460a53a5c350a9162bb903c76f3fab14c794a322
Contents?: true
Size: 1.44 KB
Versions: 18
Compression:
Stored size: 1.44 KB
Contents
require 'spec_helper' describe S3Website::Cloudfront::Invalidator do describe 'default behaviour' do let(:config) {{ 's3_id' => 'aws id', 's3_secret' => 'aws secret', 'cloudfront_distribution_id' => 'EFXX' }} it 'invalidates the root resource' do invalidator = create_simple_cloudfront_invalidator(config) invalidator. should_receive(:invalidate). with(['index.html', '']). and_return(:text_report => 'report txt') S3Website::Cloudfront::Invalidator.invalidate(config, ['index.html']) end end describe 'option cloudfront_invalidate_root = true' do let(:config) {{ 's3_id' => 'aws id', 's3_secret' => 'aws secret', 'cloudfront_distribution_id' => 'EFXX', 'cloudfront_invalidate_root' => true }} it 'invalidates all root resources' do invalidator = create_simple_cloudfront_invalidator(config) invalidator. should_receive(:invalidate). with(['article/', '']). and_return(:text_report => 'report txt') S3Website::Cloudfront::Invalidator.invalidate(config, ['article/index.html']) end end def create_simple_cloudfront_invalidator(config) invalidator = double('invalidator') SimpleCloudfrontInvalidator::CloudfrontClient. should_receive(:new). with(config['s3_id'], config['s3_secret'], config['cloudfront_distribution_id']). and_return(invalidator) invalidator end end
Version data entries
18 entries across 18 versions & 1 rubygems