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:
- 2383 Bytes
1 | require File.dirname(__FILE__) + '/../spec_helper' |
2 | |
3 | context 'Given the fixture :first_page' do |
4 | fixtures :contents, :blogs |
5 | |
6 | setup { @page = contents(:first_page) } |
7 | |
8 | specify '#permalink_url should be: http://myblog.net/pages/page_one' do |
9 | @page.permalink_url.should == 'http://myblog.net/pages/page_one' |
10 | end |
11 | |
12 | specify '#edit_url should be: http://myblog.net/admin/pages/edit/9' do |
13 | @page.edit_url.should == 'http://myblog.net/admin/pages/edit/9' |
14 | end |
15 | |
16 | specify '#delete_url should work too' do |
17 | @page.delete_url.should == 'http://myblog.net/admin/pages/destroy/9' |
18 | end |
19 | |
20 | specify 'Pages cannot have the same name' do |
21 | Page.new(:name => @page.name, :body => @page.body, :title => @page.title).should_not_be_valid |
22 | Page.new(:name => @page.name, :body => 'body', :title => 'title').should_not_be_valid |
23 | end |
24 | end |
25 | |
26 | class Hash |
27 | def except(*keys) |
28 | self.reject { |k,v| keys.include? k.to_sym } |
29 | end |
30 | |
31 | def only(*keys) |
32 | self.dup.reject { |k, v| !keys.include? k.to_sym } |
33 | end |
34 | end |
35 | |
36 | module ValidPageHelper |
37 | def valid_attributes |
38 | { :name => 'name', :title => 'title', :body => 'body'} |
39 | end |
40 | end |
41 | |
42 | context 'Given no pages' do |
43 | include ValidPageHelper |
44 | |
45 | setup { @page = Page.new } |
46 | |
47 | specify 'An empty page is invalid' do |
48 | @page.should_not_be_valid |
49 | end |
50 | |
51 | specify 'A page is valid with name, title and body' do |
52 | @page.attributes = valid_attributes |
53 | @page.should_be_valid |
54 | end |
55 | |
56 | specify 'A page is invalid without a name' do |
57 | @page.attributes = valid_attributes.except(:name) |
58 | @page.should_not_be_valid |
59 | @page.errors.on(:name).should == "can't be blank" |
60 | @page.name = 'somename' |
61 | @page.should_be_valid |
62 | end |
63 | |
64 | specify 'A page is invalid without a title' do |
65 | @page.attributes = valid_attributes.except(:title) |
66 | @page.should_not_be_valid |
67 | @page.errors.on(:title).should == "can't be blank" |
68 | @page.title = 'sometitle' |
69 | @page.should_be_valid |
70 | end |
71 | |
72 | specify 'A page is invalid without a body' do |
73 | @page.attributes = valid_attributes.except(:body) |
74 | @page.should_not_be_valid |
75 | @page.errors.on(:body).should == "can't be blank" |
76 | @page.body = 'somebody' |
77 | @page.should_be_valid |
78 | end |
79 | end |
80 | |
81 | context 'Given a valid page' do |
82 | include ValidPageHelper |
83 | setup { @page = Page.new(valid_attributes) } |
84 | |
85 | specify 'default filter should be textile' do |
86 | @page.default_text_filter.name.should == 'textile' |
87 | end |
88 | end |