kuztuscms 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (197) hide show
  1. data/.gitignore +9 -0
  2. data/.rvmrc +55 -0
  3. data/Gemfile +18 -0
  4. data/Gemfile.lock +156 -0
  5. data/MIT-LICENSE +20 -0
  6. data/README.rdoc +12 -0
  7. data/Rakefile +29 -0
  8. data/app/assets/images/kuztuscms/.gitkeep +0 -0
  9. data/app/assets/images/kuztuscms/glyphicons-halflings-white.png +0 -0
  10. data/app/assets/images/kuztuscms/glyphicons-halflings.png +0 -0
  11. data/app/assets/javascripts/kuztuscms/.DS_Store +0 -0
  12. data/app/assets/javascripts/kuztuscms/application.js +15 -0
  13. data/app/assets/javascripts/kuztuscms/bootstrap.js +1720 -0
  14. data/app/assets/javascripts/kuztuscms/codemirror-compressed.js +1 -0
  15. data/app/assets/stylesheets/kuztuscms/.DS_Store +0 -0
  16. data/app/assets/stylesheets/kuztuscms/application.css.scss +16 -0
  17. data/app/assets/stylesheets/kuztuscms/bootstrap-responsive.css +581 -0
  18. data/app/assets/stylesheets/kuztuscms/bootstrap.css +3496 -0
  19. data/app/assets/stylesheets/kuztuscms/codemirror.css +115 -0
  20. data/app/controllers/kuztuscms/articles_controller.rb +53 -0
  21. data/app/controllers/kuztuscms/home_controller.rb +6 -0
  22. data/app/controllers/kuztuscms/layouts_controller.rb +75 -0
  23. data/app/controllers/kuztuscms/pages_controller.rb +73 -0
  24. data/app/controllers/kuztuscms/settings_controller.rb +48 -0
  25. data/app/controllers/kuztuscms/templates_controller.rb +72 -0
  26. data/app/controllers/kuztuscms/users_controller.rb +74 -0
  27. data/app/controllers/kuztuscms_controller.rb +23 -0
  28. data/app/helpers/kuztuscms/application_helper.rb +4 -0
  29. data/app/models/kuztuscms/article.rb +4 -0
  30. data/app/models/kuztuscms/layout.rb +14 -0
  31. data/app/models/kuztuscms/page.rb +8 -0
  32. data/app/models/kuztuscms/setting.rb +11 -0
  33. data/app/models/kuztuscms/template.rb +14 -0
  34. data/app/models/kuztuscms/user.rb +20 -0
  35. data/app/views/devise/_links.erb +27 -0
  36. data/app/views/devise/confirmations/new.html.erb +12 -0
  37. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  38. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  39. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  40. data/app/views/devise/passwords/edit.html.erb +16 -0
  41. data/app/views/devise/passwords/new.html.erb +18 -0
  42. data/app/views/devise/registrations/edit.html.erb +25 -0
  43. data/app/views/devise/registrations/new.html.erb +21 -0
  44. data/app/views/devise/sessions/new.html.erb +31 -0
  45. data/app/views/devise/unlocks/new.html.erb +19 -0
  46. data/app/views/kuztuscms/articles/_form.html.erb +35 -0
  47. data/app/views/kuztuscms/articles/edit.html.erb +1 -0
  48. data/app/views/kuztuscms/articles/index.html.erb +22 -0
  49. data/app/views/kuztuscms/articles/new.html.erb +1 -0
  50. data/app/views/kuztuscms/articles/show.html.erb +4 -0
  51. data/app/views/kuztuscms/home/index.html.erb +1 -0
  52. data/app/views/kuztuscms/layouts/_form.html.erb +58 -0
  53. data/app/views/kuztuscms/layouts/edit.html.erb +2 -0
  54. data/app/views/kuztuscms/layouts/index.html.erb +32 -0
  55. data/app/views/kuztuscms/layouts/new.html.erb +2 -0
  56. data/app/views/kuztuscms/pages/_form.html.erb +72 -0
  57. data/app/views/kuztuscms/pages/edit.html.erb +1 -0
  58. data/app/views/kuztuscms/pages/index.html.erb +28 -0
  59. data/app/views/kuztuscms/pages/new.html.erb +1 -0
  60. data/app/views/kuztuscms/pages/show.html.erb +1 -0
  61. data/app/views/kuztuscms/settings/_form.html.erb +35 -0
  62. data/app/views/kuztuscms/settings/edit.html.erb +1 -0
  63. data/app/views/kuztuscms/settings/index.html.erb +24 -0
  64. data/app/views/kuztuscms/settings/new.html.erb +1 -0
  65. data/app/views/kuztuscms/shared/_codemirror.html.erb +20 -0
  66. data/app/views/kuztuscms/templates/_form.html.erb +58 -0
  67. data/app/views/kuztuscms/templates/edit.html.erb +3 -0
  68. data/app/views/kuztuscms/templates/index.html.erb +28 -0
  69. data/app/views/kuztuscms/templates/new.html.erb +2 -0
  70. data/app/views/kuztuscms/users/_form.html.erb +56 -0
  71. data/app/views/kuztuscms/users/edit.html.erb +1 -0
  72. data/app/views/kuztuscms/users/index.html.erb +28 -0
  73. data/app/views/kuztuscms/users/new.html.erb +1 -0
  74. data/app/views/kuztuscms/users/show.html.erb +15 -0
  75. data/app/views/layouts/kuztuscms/application.html.erb +57 -0
  76. data/config/initializers/devise.rb +225 -0
  77. data/config/initializers/resolver.rb +65 -0
  78. data/config/locales/devise.en.yml +57 -0
  79. data/config/locales/en.yml +5 -0
  80. data/config/routes.rb +18 -0
  81. data/db/migrate/20120218074040_devise_create_kuztuscms_users.rb +52 -0
  82. data/db/migrate/20120218075211_create_kuztuscms_pages.rb +15 -0
  83. data/db/migrate/20120311080242_create_kuztuscms_templates.rb +38 -0
  84. data/db/migrate/20120311141419_create_kuztuscms_articles.rb +10 -0
  85. data/db/migrate/20120311173954_create_kuztuscms_layouts.rb +43 -0
  86. data/db/migrate/20120316081613_create_kuztuscms_settings.rb +10 -0
  87. data/kuztuscms.gemspec +33 -0
  88. data/lib/kuztuscms/engine.rb +13 -0
  89. data/lib/kuztuscms/settings.rb +26 -0
  90. data/lib/kuztuscms/version.rb +3 -0
  91. data/lib/kuztuscms.rb +7 -0
  92. data/lib/tasks/kuztuscms_tasks.rake +4 -0
  93. data/script/rails +8 -0
  94. data/spec/controllers/kuztuscms/articles_controller_spec.rb +164 -0
  95. data/spec/controllers/kuztuscms/languages_controller_spec.rb +164 -0
  96. data/spec/controllers/kuztuscms/layouts_controller_spec.rb +164 -0
  97. data/spec/controllers/kuztuscms/pages_controller_spec.rb +164 -0
  98. data/spec/controllers/kuztuscms/settings_controller_spec.rb +164 -0
  99. data/spec/controllers/kuztuscms/templates_controller_spec.rb +164 -0
  100. data/spec/controllers/kuztuscms/translations_controller_spec.rb +164 -0
  101. data/spec/dummy/README.rdoc +261 -0
  102. data/spec/dummy/Rakefile +7 -0
  103. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  104. data/spec/dummy/app/assets/javascripts/home.js +2 -0
  105. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  106. data/spec/dummy/app/assets/stylesheets/home.css +4 -0
  107. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  108. data/spec/dummy/app/controllers/home_controller.rb +4 -0
  109. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  110. data/spec/dummy/app/helpers/home_helper.rb +2 -0
  111. data/spec/dummy/app/mailers/.gitkeep +0 -0
  112. data/spec/dummy/app/models/.gitkeep +0 -0
  113. data/spec/dummy/app/views/home/index.html.erb +3 -0
  114. data/spec/dummy/app/views/layouts/application.html.erb +16 -0
  115. data/spec/dummy/config/application.rb +62 -0
  116. data/spec/dummy/config/boot.rb +10 -0
  117. data/spec/dummy/config/database.yml +25 -0
  118. data/spec/dummy/config/environment.rb +5 -0
  119. data/spec/dummy/config/environments/development.rb +38 -0
  120. data/spec/dummy/config/environments/production.rb +67 -0
  121. data/spec/dummy/config/environments/test.rb +37 -0
  122. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  123. data/spec/dummy/config/initializers/inflections.rb +15 -0
  124. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  125. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  126. data/spec/dummy/config/initializers/session_store.rb +8 -0
  127. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  128. data/spec/dummy/config/locales/en.yml +9 -0
  129. data/spec/dummy/config/locales/ru.yml +5 -0
  130. data/spec/dummy/config/routes.rb +8 -0
  131. data/spec/dummy/config.ru +4 -0
  132. data/spec/dummy/db/migrate/20120313083011_devise_create_kuztuscms_users.kuztuscms.rb +59 -0
  133. data/spec/dummy/db/migrate/20120313083012_create_kuztuscms_pages.kuztuscms.rb +16 -0
  134. data/spec/dummy/db/migrate/20120313083013_create_kuztuscms_templates.kuztuscms.rb +15 -0
  135. data/spec/dummy/db/migrate/20120313083014_create_kuztuscms_articles.kuztuscms.rb +11 -0
  136. data/spec/dummy/db/migrate/20120313083015_create_kuztuscms_layouts.kuztuscms.rb +41 -0
  137. data/spec/dummy/db/migrate/20120316084434_create_kuztuscms_settings.kuztuscms.rb +11 -0
  138. data/spec/dummy/db/schema.rb +90 -0
  139. data/spec/dummy/lib/assets/.gitkeep +0 -0
  140. data/spec/dummy/log/.gitkeep +0 -0
  141. data/spec/dummy/public/404.html +26 -0
  142. data/spec/dummy/public/422.html +26 -0
  143. data/spec/dummy/public/500.html +25 -0
  144. data/spec/dummy/public/favicon.ico +0 -0
  145. data/spec/dummy/script/rails +6 -0
  146. data/spec/helpers/kuztuscms/articles_helper_spec.rb +15 -0
  147. data/spec/helpers/kuztuscms/languages_helper_spec.rb +15 -0
  148. data/spec/helpers/kuztuscms/layouts_helper_spec.rb +15 -0
  149. data/spec/helpers/kuztuscms/pages_helper_spec.rb +15 -0
  150. data/spec/helpers/kuztuscms/settings_helper_spec.rb +15 -0
  151. data/spec/helpers/kuztuscms/templates_helper_spec.rb +15 -0
  152. data/spec/helpers/kuztuscms/translations_helper_spec.rb +15 -0
  153. data/spec/models/kuztuscms/article_spec.rb +5 -0
  154. data/spec/models/kuztuscms/language_spec.rb +5 -0
  155. data/spec/models/kuztuscms/layout_spec.rb +5 -0
  156. data/spec/models/kuztuscms/page_spec.rb +5 -0
  157. data/spec/models/kuztuscms/setting_spec.rb +5 -0
  158. data/spec/models/kuztuscms/template_spec.rb +5 -0
  159. data/spec/models/kuztuscms/translation_spec.rb +5 -0
  160. data/spec/models/kuztuscms/user_spec.rb +5 -0
  161. data/spec/routing/kuztuscms/articles_routing_spec.rb +35 -0
  162. data/spec/routing/kuztuscms/languages_routing_spec.rb +35 -0
  163. data/spec/routing/kuztuscms/layouts_routing_spec.rb +35 -0
  164. data/spec/routing/kuztuscms/pages_routing_spec.rb +35 -0
  165. data/spec/routing/kuztuscms/settings_routing_spec.rb +35 -0
  166. data/spec/routing/kuztuscms/templates_routing_spec.rb +35 -0
  167. data/spec/routing/kuztuscms/translations_routing_spec.rb +35 -0
  168. data/spec/views/kuztuscms/articles/edit.html.erb_spec.rb +20 -0
  169. data/spec/views/kuztuscms/articles/index.html.erb_spec.rb +24 -0
  170. data/spec/views/kuztuscms/articles/new.html.erb_spec.rb +20 -0
  171. data/spec/views/kuztuscms/articles/show.html.erb_spec.rb +18 -0
  172. data/spec/views/kuztuscms/languages/edit.html.erb_spec.rb +22 -0
  173. data/spec/views/kuztuscms/languages/index.html.erb_spec.rb +28 -0
  174. data/spec/views/kuztuscms/languages/new.html.erb_spec.rb +22 -0
  175. data/spec/views/kuztuscms/languages/show.html.erb_spec.rb +21 -0
  176. data/spec/views/kuztuscms/layouts/edit.html.erb_spec.rb +20 -0
  177. data/spec/views/kuztuscms/layouts/index.html.erb_spec.rb +24 -0
  178. data/spec/views/kuztuscms/layouts/new.html.erb_spec.rb +20 -0
  179. data/spec/views/kuztuscms/layouts/show.html.erb_spec.rb +18 -0
  180. data/spec/views/kuztuscms/pages/edit.html.erb_spec.rb +15 -0
  181. data/spec/views/kuztuscms/pages/index.html.erb_spec.rb +14 -0
  182. data/spec/views/kuztuscms/pages/new.html.erb_spec.rb +15 -0
  183. data/spec/views/kuztuscms/pages/show.html.erb_spec.rb +11 -0
  184. data/spec/views/kuztuscms/settings/edit.html.erb_spec.rb +20 -0
  185. data/spec/views/kuztuscms/settings/index.html.erb_spec.rb +24 -0
  186. data/spec/views/kuztuscms/settings/new.html.erb_spec.rb +20 -0
  187. data/spec/views/kuztuscms/settings/show.html.erb_spec.rb +18 -0
  188. data/spec/views/kuztuscms/templates/edit.html.erb_spec.rb +28 -0
  189. data/spec/views/kuztuscms/templates/index.html.erb_spec.rb +40 -0
  190. data/spec/views/kuztuscms/templates/new.html.erb_spec.rb +28 -0
  191. data/spec/views/kuztuscms/templates/show.html.erb_spec.rb +30 -0
  192. data/spec/views/kuztuscms/translations/edit.html.erb_spec.rb +28 -0
  193. data/spec/views/kuztuscms/translations/index.html.erb_spec.rb +40 -0
  194. data/spec/views/kuztuscms/translations/new.html.erb_spec.rb +28 -0
  195. data/spec/views/kuztuscms/translations/show.html.erb_spec.rb +30 -0
  196. data/test/integration/kuztuscms/setting_test.rb +7 -0
  197. metadata +351 -0
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe LayoutsController do
4
+ describe "routing" do
5
+
6
+ it "routes to #index" do
7
+ get("/layouts").should route_to("layouts#index")
8
+ end
9
+
10
+ it "routes to #new" do
11
+ get("/layouts/new").should route_to("layouts#new")
12
+ end
13
+
14
+ it "routes to #show" do
15
+ get("/layouts/1").should route_to("layouts#show", :id => "1")
16
+ end
17
+
18
+ it "routes to #edit" do
19
+ get("/layouts/1/edit").should route_to("layouts#edit", :id => "1")
20
+ end
21
+
22
+ it "routes to #create" do
23
+ post("/layouts").should route_to("layouts#create")
24
+ end
25
+
26
+ it "routes to #update" do
27
+ put("/layouts/1").should route_to("layouts#update", :id => "1")
28
+ end
29
+
30
+ it "routes to #destroy" do
31
+ delete("/layouts/1").should route_to("layouts#destroy", :id => "1")
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe PagesController do
4
+ describe "routing" do
5
+
6
+ it "routes to #index" do
7
+ get("/pages").should route_to("pages#index")
8
+ end
9
+
10
+ it "routes to #new" do
11
+ get("/pages/new").should route_to("pages#new")
12
+ end
13
+
14
+ it "routes to #show" do
15
+ get("/pages/1").should route_to("pages#show", :id => "1")
16
+ end
17
+
18
+ it "routes to #edit" do
19
+ get("/pages/1/edit").should route_to("pages#edit", :id => "1")
20
+ end
21
+
22
+ it "routes to #create" do
23
+ post("/pages").should route_to("pages#create")
24
+ end
25
+
26
+ it "routes to #update" do
27
+ put("/pages/1").should route_to("pages#update", :id => "1")
28
+ end
29
+
30
+ it "routes to #destroy" do
31
+ delete("/pages/1").should route_to("pages#destroy", :id => "1")
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe SettingsController do
4
+ describe "routing" do
5
+
6
+ it "routes to #index" do
7
+ get("/settings").should route_to("settings#index")
8
+ end
9
+
10
+ it "routes to #new" do
11
+ get("/settings/new").should route_to("settings#new")
12
+ end
13
+
14
+ it "routes to #show" do
15
+ get("/settings/1").should route_to("settings#show", :id => "1")
16
+ end
17
+
18
+ it "routes to #edit" do
19
+ get("/settings/1/edit").should route_to("settings#edit", :id => "1")
20
+ end
21
+
22
+ it "routes to #create" do
23
+ post("/settings").should route_to("settings#create")
24
+ end
25
+
26
+ it "routes to #update" do
27
+ put("/settings/1").should route_to("settings#update", :id => "1")
28
+ end
29
+
30
+ it "routes to #destroy" do
31
+ delete("/settings/1").should route_to("settings#destroy", :id => "1")
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe TemplatesController do
4
+ describe "routing" do
5
+
6
+ it "routes to #index" do
7
+ get("/templates").should route_to("templates#index")
8
+ end
9
+
10
+ it "routes to #new" do
11
+ get("/templates/new").should route_to("templates#new")
12
+ end
13
+
14
+ it "routes to #show" do
15
+ get("/templates/1").should route_to("templates#show", :id => "1")
16
+ end
17
+
18
+ it "routes to #edit" do
19
+ get("/templates/1/edit").should route_to("templates#edit", :id => "1")
20
+ end
21
+
22
+ it "routes to #create" do
23
+ post("/templates").should route_to("templates#create")
24
+ end
25
+
26
+ it "routes to #update" do
27
+ put("/templates/1").should route_to("templates#update", :id => "1")
28
+ end
29
+
30
+ it "routes to #destroy" do
31
+ delete("/templates/1").should route_to("templates#destroy", :id => "1")
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ require "spec_helper"
2
+
3
+ describe TranslationsController do
4
+ describe "routing" do
5
+
6
+ it "routes to #index" do
7
+ get("/translations").should route_to("translations#index")
8
+ end
9
+
10
+ it "routes to #new" do
11
+ get("/translations/new").should route_to("translations#new")
12
+ end
13
+
14
+ it "routes to #show" do
15
+ get("/translations/1").should route_to("translations#show", :id => "1")
16
+ end
17
+
18
+ it "routes to #edit" do
19
+ get("/translations/1/edit").should route_to("translations#edit", :id => "1")
20
+ end
21
+
22
+ it "routes to #create" do
23
+ post("/translations").should route_to("translations#create")
24
+ end
25
+
26
+ it "routes to #update" do
27
+ put("/translations/1").should route_to("translations#update", :id => "1")
28
+ end
29
+
30
+ it "routes to #destroy" do
31
+ delete("/translations/1").should route_to("translations#destroy", :id => "1")
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe "articles/edit" do
4
+ before(:each) do
5
+ @article = assign(:article, stub_model(Article,
6
+ :name => "MyString",
7
+ :body => "MyText"
8
+ ))
9
+ end
10
+
11
+ it "renders the edit article form" do
12
+ render
13
+
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ assert_select "form", :action => articles_path(@article), :method => "post" do
16
+ assert_select "input#article_name", :name => "article[name]"
17
+ assert_select "textarea#article_body", :name => "article[body]"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ describe "articles/index" do
4
+ before(:each) do
5
+ assign(:articles, [
6
+ stub_model(Article,
7
+ :name => "Name",
8
+ :body => "MyText"
9
+ ),
10
+ stub_model(Article,
11
+ :name => "Name",
12
+ :body => "MyText"
13
+ )
14
+ ])
15
+ end
16
+
17
+ it "renders a list of articles" do
18
+ render
19
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
20
+ assert_select "tr>td", :text => "Name".to_s, :count => 2
21
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
22
+ assert_select "tr>td", :text => "MyText".to_s, :count => 2
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe "articles/new" do
4
+ before(:each) do
5
+ assign(:article, stub_model(Article,
6
+ :name => "MyString",
7
+ :body => "MyText"
8
+ ).as_new_record)
9
+ end
10
+
11
+ it "renders new article form" do
12
+ render
13
+
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ assert_select "form", :action => articles_path, :method => "post" do
16
+ assert_select "input#article_name", :name => "article[name]"
17
+ assert_select "textarea#article_body", :name => "article[body]"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe "articles/show" do
4
+ before(:each) do
5
+ @article = assign(:article, stub_model(Article,
6
+ :name => "Name",
7
+ :body => "MyText"
8
+ ))
9
+ end
10
+
11
+ it "renders attributes in <p>" do
12
+ render
13
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
14
+ rendered.should match(/Name/)
15
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
16
+ rendered.should match(/MyText/)
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe "languages/edit" do
4
+ before(:each) do
5
+ @language = assign(:language, stub_model(Language,
6
+ :name => "MyString",
7
+ :code => "MyString",
8
+ :default => false
9
+ ))
10
+ end
11
+
12
+ it "renders the edit language form" do
13
+ render
14
+
15
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
16
+ assert_select "form", :action => languages_path(@language), :method => "post" do
17
+ assert_select "input#language_name", :name => "language[name]"
18
+ assert_select "input#language_code", :name => "language[code]"
19
+ assert_select "input#language_default", :name => "language[default]"
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe "languages/index" do
4
+ before(:each) do
5
+ assign(:languages, [
6
+ stub_model(Language,
7
+ :name => "Name",
8
+ :code => "Code",
9
+ :default => false
10
+ ),
11
+ stub_model(Language,
12
+ :name => "Name",
13
+ :code => "Code",
14
+ :default => false
15
+ )
16
+ ])
17
+ end
18
+
19
+ it "renders a list of languages" do
20
+ render
21
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
22
+ assert_select "tr>td", :text => "Name".to_s, :count => 2
23
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
24
+ assert_select "tr>td", :text => "Code".to_s, :count => 2
25
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
26
+ assert_select "tr>td", :text => false.to_s, :count => 2
27
+ end
28
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe "languages/new" do
4
+ before(:each) do
5
+ assign(:language, stub_model(Language,
6
+ :name => "MyString",
7
+ :code => "MyString",
8
+ :default => false
9
+ ).as_new_record)
10
+ end
11
+
12
+ it "renders new language form" do
13
+ render
14
+
15
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
16
+ assert_select "form", :action => languages_path, :method => "post" do
17
+ assert_select "input#language_name", :name => "language[name]"
18
+ assert_select "input#language_code", :name => "language[code]"
19
+ assert_select "input#language_default", :name => "language[default]"
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe "languages/show" do
4
+ before(:each) do
5
+ @language = assign(:language, stub_model(Language,
6
+ :name => "Name",
7
+ :code => "Code",
8
+ :default => false
9
+ ))
10
+ end
11
+
12
+ it "renders attributes in <p>" do
13
+ render
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ rendered.should match(/Name/)
16
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
17
+ rendered.should match(/Code/)
18
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
19
+ rendered.should match(/false/)
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe "layouts/edit" do
4
+ before(:each) do
5
+ @layout = assign(:layout, stub_model(Layout,
6
+ :name => "MyString",
7
+ :content => "MyText"
8
+ ))
9
+ end
10
+
11
+ it "renders the edit layout form" do
12
+ render
13
+
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ assert_select "form", :action => layouts_path(@layout), :method => "post" do
16
+ assert_select "input#layout_name", :name => "layout[name]"
17
+ assert_select "textarea#layout_content", :name => "layout[content]"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ describe "layouts/index" do
4
+ before(:each) do
5
+ assign(:layouts, [
6
+ stub_model(Layout,
7
+ :name => "Name",
8
+ :content => "MyText"
9
+ ),
10
+ stub_model(Layout,
11
+ :name => "Name",
12
+ :content => "MyText"
13
+ )
14
+ ])
15
+ end
16
+
17
+ it "renders a list of layouts" do
18
+ render
19
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
20
+ assert_select "tr>td", :text => "Name".to_s, :count => 2
21
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
22
+ assert_select "tr>td", :text => "MyText".to_s, :count => 2
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe "layouts/new" do
4
+ before(:each) do
5
+ assign(:layout, stub_model(Layout,
6
+ :name => "MyString",
7
+ :content => "MyText"
8
+ ).as_new_record)
9
+ end
10
+
11
+ it "renders new layout form" do
12
+ render
13
+
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ assert_select "form", :action => layouts_path, :method => "post" do
16
+ assert_select "input#layout_name", :name => "layout[name]"
17
+ assert_select "textarea#layout_content", :name => "layout[content]"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe "layouts/show" do
4
+ before(:each) do
5
+ @layout = assign(:layout, stub_model(Layout,
6
+ :name => "Name",
7
+ :content => "MyText"
8
+ ))
9
+ end
10
+
11
+ it "renders attributes in <p>" do
12
+ render
13
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
14
+ rendered.should match(/Name/)
15
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
16
+ rendered.should match(/MyText/)
17
+ end
18
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe "pages/edit" do
4
+ before(:each) do
5
+ @page = assign(:page, stub_model(Page))
6
+ end
7
+
8
+ it "renders the edit page form" do
9
+ render
10
+
11
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
12
+ assert_select "form", :action => pages_path(@page), :method => "post" do
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe "pages/index" do
4
+ before(:each) do
5
+ assign(:pages, [
6
+ stub_model(Page),
7
+ stub_model(Page)
8
+ ])
9
+ end
10
+
11
+ it "renders a list of pages" do
12
+ render
13
+ end
14
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe "pages/new" do
4
+ before(:each) do
5
+ assign(:page, stub_model(Page).as_new_record)
6
+ end
7
+
8
+ it "renders new page form" do
9
+ render
10
+
11
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
12
+ assert_select "form", :action => pages_path, :method => "post" do
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe "pages/show" do
4
+ before(:each) do
5
+ @page = assign(:page, stub_model(Page))
6
+ end
7
+
8
+ it "renders attributes in <p>" do
9
+ render
10
+ end
11
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe "settings/edit" do
4
+ before(:each) do
5
+ @setting = assign(:setting, stub_model(Setting,
6
+ :key => "MyString",
7
+ :value => "MyString"
8
+ ))
9
+ end
10
+
11
+ it "renders the edit setting form" do
12
+ render
13
+
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ assert_select "form", :action => settings_path(@setting), :method => "post" do
16
+ assert_select "input#setting_key", :name => "setting[key]"
17
+ assert_select "input#setting_value", :name => "setting[value]"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ describe "settings/index" do
4
+ before(:each) do
5
+ assign(:settings, [
6
+ stub_model(Setting,
7
+ :key => "Key",
8
+ :value => "Value"
9
+ ),
10
+ stub_model(Setting,
11
+ :key => "Key",
12
+ :value => "Value"
13
+ )
14
+ ])
15
+ end
16
+
17
+ it "renders a list of settings" do
18
+ render
19
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
20
+ assert_select "tr>td", :text => "Key".to_s, :count => 2
21
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
22
+ assert_select "tr>td", :text => "Value".to_s, :count => 2
23
+ end
24
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe "settings/new" do
4
+ before(:each) do
5
+ assign(:setting, stub_model(Setting,
6
+ :key => "MyString",
7
+ :value => "MyString"
8
+ ).as_new_record)
9
+ end
10
+
11
+ it "renders new setting form" do
12
+ render
13
+
14
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
15
+ assert_select "form", :action => settings_path, :method => "post" do
16
+ assert_select "input#setting_key", :name => "setting[key]"
17
+ assert_select "input#setting_value", :name => "setting[value]"
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe "settings/show" do
4
+ before(:each) do
5
+ @setting = assign(:setting, stub_model(Setting,
6
+ :key => "Key",
7
+ :value => "Value"
8
+ ))
9
+ end
10
+
11
+ it "renders attributes in <p>" do
12
+ render
13
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
14
+ rendered.should match(/Key/)
15
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
16
+ rendered.should match(/Value/)
17
+ end
18
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe "templates/edit" do
4
+ before(:each) do
5
+ @template = assign(:template, stub_model(Template,
6
+ :body => "MyText",
7
+ :path => "MyString",
8
+ :format => "MyString",
9
+ :locale => "MyString",
10
+ :handler => "MyString",
11
+ :partial => false
12
+ ))
13
+ end
14
+
15
+ it "renders the edit template form" do
16
+ render
17
+
18
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
19
+ assert_select "form", :action => templates_path(@template), :method => "post" do
20
+ assert_select "textarea#template_body", :name => "template[body]"
21
+ assert_select "input#template_path", :name => "template[path]"
22
+ assert_select "input#template_format", :name => "template[format]"
23
+ assert_select "input#template_locale", :name => "template[locale]"
24
+ assert_select "input#template_handler", :name => "template[handler]"
25
+ assert_select "input#template_partial", :name => "template[partial]"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ describe "templates/index" do
4
+ before(:each) do
5
+ assign(:templates, [
6
+ stub_model(Template,
7
+ :body => "MyText",
8
+ :path => "Path",
9
+ :format => "Format",
10
+ :locale => "Locale",
11
+ :handler => "Handler",
12
+ :partial => false
13
+ ),
14
+ stub_model(Template,
15
+ :body => "MyText",
16
+ :path => "Path",
17
+ :format => "Format",
18
+ :locale => "Locale",
19
+ :handler => "Handler",
20
+ :partial => false
21
+ )
22
+ ])
23
+ end
24
+
25
+ it "renders a list of templates" do
26
+ render
27
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
28
+ assert_select "tr>td", :text => "MyText".to_s, :count => 2
29
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
30
+ assert_select "tr>td", :text => "Path".to_s, :count => 2
31
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
32
+ assert_select "tr>td", :text => "Format".to_s, :count => 2
33
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
34
+ assert_select "tr>td", :text => "Locale".to_s, :count => 2
35
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
36
+ assert_select "tr>td", :text => "Handler".to_s, :count => 2
37
+ # Run the generator again with the --webrat flag if you want to use webrat matchers
38
+ assert_select "tr>td", :text => false.to_s, :count => 2
39
+ end
40
+ end