Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 44 lines (38 sloc) 2.561 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
Feature: uploader with file storage and a processor that reverses the file
In order to be awesome
As a developer using CarrierWave
I want to upload files to the filesystem

Background:
Given an uploader class that uses the 'file' storage
And an instance of that class
And the class has a method called 'reverse' that reverses the contents of a file
And the class will process 'reverse'

Scenario: store a file
When I store the file 'fixtures/bork.txt'
Then there should be a file at 'public/uploads/bork.txt'
And the file at 'public/uploads/bork.txt' should not be identical to the file at 'fixtures/bork.txt'
And the file at 'public/uploads/bork.txt' should be the reverse of the file at 'fixtures/bork.txt'

Scenario: store two files in succession
When I store the file 'fixtures/bork.txt'
Then there should be a file at 'public/uploads/bork.txt'
And the file at 'public/uploads/bork.txt' should not be identical to the file at 'fixtures/bork.txt'
And the file at 'public/uploads/bork.txt' should be the reverse of the file at 'fixtures/bork.txt'
When I store the file 'fixtures/monkey.txt'
Then there should be a file at 'public/uploads/monkey.txt'
And the file at 'public/uploads/monkey.txt' should not be identical to the file at 'fixtures/monkey.txt'
And the file at 'public/uploads/monkey.txt' should be the reverse of the file at 'fixtures/monkey.txt'

Scenario: cache a file and then store it
When I cache the file 'fixtures/bork.txt'
Then there should be a file called 'bork.txt' somewhere in a subdirectory of 'public/uploads/tmp'
And the file called 'bork.txt' in a subdirectory of 'public/uploads/tmp' should not be identical to the file at 'fixtures/bork.txt'
And there should not be a file at 'public/uploads/bork.txt'
When I store the file
Then there should be a file at 'public/uploads/bork.txt'
And the file at 'public/uploads/bork.txt' should not be identical to the file at 'fixtures/bork.txt'
And the file at 'public/uploads/bork.txt' should be the reverse of the file at 'fixtures/bork.txt'

Scenario: retrieving a file from cache then storing
Given the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/20090212-2343-8336-0348/bork.txt'
When I retrieve the cache name '20090212-2343-8336-0348/bork.txt' from the cache
And I store the file
Then there should be a file at 'public/uploads/bork.txt'
And the file at 'public/uploads/bork.txt' should be identical to the file at 'fixtures/bork.txt'
Something went wrong with that request. Please try again.