manageable_content 0.0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,19 +7,25 @@ describe "The Controller Dsl" do
7
7
  context "manageable_layout_content_for" do
8
8
  it "should configure the layout content keys for layout" do
9
9
  ManageableContent::Controllers::Dsl.manageable_layout_content_keys['application'].should ==
10
- [:footer_copyright, :footer_contact]
10
+ {:footer_copyright => :text, :footer_contact => :string}
11
11
 
12
12
  ManageableContent::Controllers::Dsl.manageable_layout_content_keys['blog'].should ==
13
- [:blog_title]
13
+ {:blog_title => :text}
14
14
  end
15
15
  end
16
16
 
17
17
  context "manageable_content_for" do
18
18
  it "should configure the content keys for the HomeController" do
19
- HomeController.manageable_content_keys.should == [:title, :keywords, :body, :side]
19
+ HomeController.manageable_content_keys.should == {
20
+ :title => :string, :keywords => :text,
21
+ :body => :text, :side => :text
22
+ }
20
23
  end
21
24
  it "should configure the content keys for the ContactController" do
22
- ContactController.manageable_content_keys.should == [:title, :keywords, :body, :message]
25
+ ContactController.manageable_content_keys.should == {
26
+ :title => :string, :keywords => :text,
27
+ :body => :text, :message => :text
28
+ }
23
29
  end
24
30
  end
25
31
  end
@@ -26,10 +26,10 @@ describe ManageableContent::Manager do
26
26
  page.key.should == 'application'
27
27
  page.locale.should == locale.to_s
28
28
  page.page_contents.size.should == 4
29
- page.page_content(:title).should_not be_nil
30
- page.page_content(:keywords).should_not be_nil
31
- page.page_content(:footer_copyright).should_not be_nil
32
- page.page_content(:footer_contact).should_not be_nil
29
+ page.page_content(:title).short.should be_true
30
+ page.page_content(:keywords).short.should be_false
31
+ page.page_content(:footer_copyright).short.should be_false
32
+ page.page_content(:footer_contact).short.should be_true
33
33
  end
34
34
  end
35
35
  end
@@ -42,7 +42,7 @@ describe ManageableContent::Manager do
42
42
  page.key.should == 'blog'
43
43
  page.locale.should == locale.to_s
44
44
  page.page_contents.size.should == 1
45
- page.page_content(:blog_title).should_not be_nil
45
+ page.page_content(:blog_title).short.should be_false
46
46
  end
47
47
  end
48
48
  end
@@ -58,10 +58,10 @@ describe ManageableContent::Manager do
58
58
  page.key.should == controller_path
59
59
  page.locale.should == locale.to_s
60
60
  page.page_contents.size.should == 4
61
- page.page_content(:title).should_not be_nil
62
- page.page_content(:keywords).should_not be_nil
63
- page.page_content(:body).should_not be_nil
64
- page.page_content(:side).should_not be_nil
61
+ page.page_content(:title).short.should be_true
62
+ page.page_content(:keywords).short.should be_false
63
+ page.page_content(:body).short.should be_false
64
+ page.page_content(:side).short.should be_false
65
65
  end
66
66
  end
67
67
  end
@@ -76,10 +76,10 @@ describe ManageableContent::Manager do
76
76
  page.key.should == controller_path
77
77
  page.locale.should == locale.to_s
78
78
  page.page_contents.size.should == 4
79
- page.page_content(:title).should_not be_nil
80
- page.page_content(:keywords).should_not be_nil
81
- page.page_content(:body).should_not be_nil
82
- page.page_content(:message).should_not be_nil
79
+ page.page_content(:title).short.should be_true
80
+ page.page_content(:keywords).short.should be_false
81
+ page.page_content(:body).short.should be_false
82
+ page.page_content(:message).short.should be_false
83
83
  end
84
84
  end
85
85
  end
@@ -109,6 +109,11 @@ describe ManageableContent::Manager do
109
109
  end
110
110
  end.flatten
111
111
  end
112
+
113
+ it "should list the eligible contents" do
114
+ ManageableContent::Manager.eligible_contents(HomeController.controller_path).should ==
115
+ {:title => :string, :keywords => :text, :body => :text, :side => :text}
116
+ end
112
117
  end
113
118
 
114
119
  context "page" do
@@ -6,6 +6,7 @@ describe ManageableContent::PageContent do
6
6
  it { should have_db_column(:page_id).of_type(:integer) }
7
7
  it { should have_db_column(:key).of_type(:string) }
8
8
  it { should have_db_column(:content).of_type(:text) }
9
+ it { should have_db_column(:short).of_type(:boolean) }
9
10
  it { should have_db_column(:created_at).of_type(:datetime) }
10
11
  it { should have_db_column(:updated_at).of_type(:datetime) }
11
12
 
@@ -17,6 +18,7 @@ describe ManageableContent::PageContent do
17
18
 
18
19
  it { should_not allow_mass_assignment_of(:key) }
19
20
  it { should_not allow_mass_assignment_of(:page_id) }
21
+ it { should_not allow_mass_assignment_of(:short) }
20
22
  it { should_not allow_mass_assignment_of(:updated_at) }
21
23
  it { should_not allow_mass_assignment_of(:created_at) }
22
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: manageable_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-18 00:00:00.000000000 -07:00
12
+ date: 2011-08-23 00:00:00.000000000 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &13599980 !ruby/object:Gem::Requirement
17
+ requirement: &14563840 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.1.0.rc6
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *13599980
25
+ version_requirements: *14563840
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: sqlite3
28
- requirement: &13599440 !ruby/object:Gem::Requirement
28
+ requirement: &14563300 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *13599440
36
+ version_requirements: *14563300
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec-rails
39
- requirement: &13598780 !ruby/object:Gem::Requirement
39
+ requirement: &14562640 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: '2.5'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *13598780
47
+ version_requirements: *14562640
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: shoulda-matchers
50
- requirement: &13598240 !ruby/object:Gem::Requirement
50
+ requirement: &14562100 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *13598240
58
+ version_requirements: *14562100
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: database_cleaner
61
- requirement: &13597660 !ruby/object:Gem::Requirement
61
+ requirement: &14561520 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *13597660
69
+ version_requirements: *14561520
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: capybara
72
- requirement: &13597120 !ruby/object:Gem::Requirement
72
+ requirement: &14560980 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :development
79
79
  prerelease: false
80
- version_requirements: *13597120
80
+ version_requirements: *14560980
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: launchy
83
- requirement: &13596580 !ruby/object:Gem::Requirement
83
+ requirement: &14560440 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: '0'
89
89
  type: :development
90
90
  prerelease: false
91
- version_requirements: *13596580
91
+ version_requirements: *14560440
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: factory_girl
94
- requirement: &13596100 !ruby/object:Gem::Requirement
94
+ requirement: &14559900 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ! '>='
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: '0'
100
100
  type: :development
101
101
  prerelease: false
102
- version_requirements: *13596100
102
+ version_requirements: *14559900
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: guard-bundler
105
- requirement: &13595620 !ruby/object:Gem::Requirement
105
+ requirement: &14559360 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ! '>='
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: '0'
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *13595620
113
+ version_requirements: *14559360
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: guard-rspec
116
- requirement: &13595080 !ruby/object:Gem::Requirement
116
+ requirement: &14558820 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ! '>='
@@ -121,7 +121,7 @@ dependencies:
121
121
  version: '0'
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *13595080
124
+ version_requirements: *14558820
125
125
  description: A content management framework for Rails 3.1
126
126
  email:
127
127
  - fabiokr@gmail.com
@@ -144,6 +144,7 @@ files:
144
144
  - MIT-LICENSE
145
145
  - Rakefile
146
146
  - README.rdoc
147
+ - CHANGELOG.rdoc
147
148
  - spec/dummy/public/404.html
148
149
  - spec/dummy/public/422.html
149
150
  - spec/dummy/public/favicon.ico