Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 193
- Log:
First stage commit of Typo 4.1, modified for the ROOL site.
Includes all local modifications but a final pass needs to be
made to delete any files left over from earlier Typo versions
that shouldn't be here anymore. See the 'tags' section of the
repository for a clean Typo 4.1 tree.Note that symlinks to shared files in the RISC OS Open theme
directory have been deliberately included this time around; I
decided that on balance it was better to leave them in as
placeholders, since unlike symlinks in app/views/shared, the
Typo theme structure is not a standard Rails concept.
- Author:
- rool
- Date:
- Wed Apr 04 18:51:02 +0100 2007
- Size:
- 1492 Bytes
1 | require File.dirname(__FILE__) + '/../spec_helper' |
2 | |
3 | context 'With the resource fixtures loaded and their equivalent files in place on the disk' do |
4 | fixtures(:resources) |
5 | |
6 | setup do |
7 | FileUtils.mkpath(RAILS_ROOT + '/public/files') |
8 | Resource.find(:all).each {|f| FileUtils.touch(f.fullpath)} |
9 | end |
10 | |
11 | teardown do |
12 | [:resource1, :resource2, :resource3].each do |sym| |
13 | res = resources(sym) |
14 | File.unlink(res.fullpath) if File.exist?(res.fullpath) |
15 | end |
16 | end |
17 | |
18 | specify 'there are three resources in the database' do |
19 | Resource.count.should == 3 |
20 | end |
21 | |
22 | specify 'fullpath should be RAILS_ROOT + "/public/files/" + resource.filename' do |
23 | res = Resource.new(:article_id => 1, :filename => 'a_new_file', :mime => 'image/jpeg', :size => 110) |
24 | res.fullpath.should == RAILS_ROOT + "/public/files/a_new_file" |
25 | end |
26 | |
27 | specify 'resources created with the same name as an existing resource don\'t overwrite the old resource' do |
28 | resources(:resource1).should_not_be_nil |
29 | f1 = Resource.create(:filename => resources(:resource1).filename, |
30 | :mime => resources(:resource1).mime) |
31 | f1.should_not_be_nil |
32 | f1.should_be_valid |
33 | |
34 | f1.filename.should_not == resources(:resource1).filename |
35 | f1.destroy |
36 | end |
37 | |
38 | specify 'a resource deletes its associated file on destruction' do |
39 | File.exist?(RAILS_ROOT + '/public/files/me.jpg').should_be true |
40 | Resource.destroy(1) |
41 | File.exist?(RAILS_ROOT + '/public/files/me.jpg').should_be false |
42 | end |
43 | end |