File: caching.feature

package info (click to toggle)
ruby-carrierwave 1.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,692 kB
  • sloc: ruby: 9,881; sh: 26; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 1,689 bytes parent folder | download | duplicates (2)
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
Feature: uploader with file storage
  In order to be able to temporarily store files to disk
  As a developer using CarrierWave
  I want to cache files

  Scenario: cache a file
    Given an uploader class that uses the 'file' storage
    And an instance of that class
    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 be identical to the file at 'fixtures/bork.txt'

  Scenario: cache two files in succession
    Given an uploader class that uses the 'file' storage
    And an instance of that class
    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 be identical to the file at 'fixtures/bork.txt'
    When I cache the file 'fixtures/monkey.txt'
    Then there should be a file called 'monkey.txt' somewhere in a subdirectory of 'public/uploads/tmp'
    And the file called 'monkey.txt' in a subdirectory of 'public/uploads/tmp' should be identical to the file at 'fixtures/monkey.txt'

  Scenario: retrieving a file from cache
    Given an uploader class that uses the 'file' storage
    And an instance of that class
    And the file 'fixtures/bork.txt' is cached file at 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt'
    When I retrieve the cache name '1369894322-345-1234-2255/bork.txt' from the cache
    Then the uploader should have 'public/uploads/tmp/1369894322-345-1234-2255/bork.txt' as its current path