Skip to content

Commit

Permalink
Merge pull request #50 from Turistforeningen/refactor/test-refactor
Browse files Browse the repository at this point in the history
Minor test suite style refactoring
  • Loading branch information
Starefossen committed Oct 16, 2015
2 parents 59d31f0 + 91b309d commit ee5ad42
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dev:
image: starefossen/iojs-imagemagick:2-6
image: starefossen/iojs-imagemagick:latest
working_dir: /usr/src/app
volumes:
- ".:/usr/src/app"
Expand Down
10 changes: 3 additions & 7 deletions test/suite.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ describe 'Upload', ->
assert.equal upload.opts.url, 'https://s3-my-region-1.amazonaws.com/b/'

it 'sets custom url', ->
upload = new Upload 'myBucket', url: 'http://cdn.app.com/'
upload = new Upload 'b', url: 'http://cdn.app.com/'
assert.equal upload.opts.url, 'http://cdn.app.com/'

it 'connects to AWS S3 using environment variables', (done) ->
@timeout 10000

upload = new Upload process.env.AWS_BUCKET_NAME

upload.s3.headBucket upload.opts.aws.params, (err, data) ->
assert.ifError err
done()
upload.s3.headBucket upload.opts.aws.params, done

it 'connects to AWS S3 using constructor options', (done) ->
@timeout 10000
Expand All @@ -116,9 +114,7 @@ describe 'Upload', ->
accessKeyId: process.env.AWS_ACCESS_KEY_ID
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY

upload.s3.headBucket upload.opts.aws.params, (err, data) ->
assert.ifError err
done()
upload.s3.headBucket upload.opts.aws.params, done

describe '#_getRandomPath()', ->
it 'returns a new random path', ->
Expand Down

0 comments on commit ee5ad42

Please sign in to comment.