alchemy_cms 2.0.7 → 2.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -4
- data/.travis.yml +1 -1
- data/Gemfile +7 -2
- data/README.md +6 -6
- data/Rakefile +26 -18
- data/alchemy_cms.gemspec +14 -14
- data/{assets/stylesheets → app/assets/images/alchemy}/Jcrop.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/ajax_loader.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/alchemy-logo.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/flags.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/navi-tab.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/shading_90.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/toggle.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/icons.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/image_loader.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow_bg.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow_bg_hover.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/placeholder.png +0 -0
- data/{assets/images/gui → app/assets/images/alchemy}/shading.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/swfupload/browse_button.png +0 -0
- data/{assets/stylesheets/default/img → app/assets/images/alchemy}/tabs.gif +0 -0
- data/{assets/images/jquery-ui → app/assets/images/alchemy}/ui-icons_666666_256x240.png +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js +212 -0
- data/app/assets/javascripts/alchemy/alchemy.buttons.js +36 -0
- data/app/assets/javascripts/alchemy/alchemy.dirty.js +91 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +114 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.element_editor_selector.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.growler.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.image_cropper.js +0 -0
- data/app/assets/javascripts/alchemy/alchemy.js +26 -0
- data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +17 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.link_overlay.js +1 -1
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.page_sorter.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.preview.js +0 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js +438 -0
- data/app/assets/stylesheets/alchemy/_defaults.scss +160 -0
- data/app/assets/stylesheets/alchemy/alchemy.css +9 -0
- data/{assets/stylesheets/alchemy.css → app/assets/stylesheets/alchemy/base.css.scss} +216 -353
- data/{assets/stylesheets/elements.css → app/assets/stylesheets/alchemy/elements.css.scss} +41 -70
- data/{assets/stylesheets/flags.css → app/assets/stylesheets/alchemy/flags.css.scss} +1 -1
- data/{assets/stylesheets/jquery-ui-1.8.7.alchemy.css → app/assets/stylesheets/alchemy/jquery-ui.alchemy.css} +15 -15
- data/{assets/stylesheets/jquery.Jcrop.css → app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss} +3 -3
- data/{assets/stylesheets/jquery.sb.css → app/assets/stylesheets/alchemy/jquery.sb.css.scss} +19 -29
- data/{assets/stylesheets → app/assets/stylesheets/alchemy}/print.css +6 -1
- data/{assets/stylesheets → app/assets/stylesheets/alchemy}/standard_set.css +0 -0
- data/{assets/stylesheets/alchemy_tinymce_content.css → app/assets/stylesheets/alchemy/tinymce_content.css} +0 -0
- data/{assets/stylesheets/alchemy_tinymce_dialog.css → app/assets/stylesheets/alchemy/tinymce_dialog.css} +2 -2
- data/app/controllers/admin/attachments_controller.rb +2 -8
- data/app/controllers/admin/clipboard_controller.rb +2 -2
- data/app/controllers/admin/contents_controller.rb +4 -16
- data/app/controllers/admin/elements_controller.rb +2 -2
- data/app/controllers/admin/essence_audios_controller.rb +0 -3
- data/app/controllers/admin/essence_files_controller.rb +0 -11
- data/app/controllers/admin/essence_flashes_controller.rb +0 -3
- data/app/controllers/admin/essence_pictures_controller.rb +2 -7
- data/app/controllers/admin/essence_videos_controller.rb +0 -3
- data/app/controllers/admin/languages_controller.rb +4 -10
- data/app/controllers/admin/pages_controller.rb +6 -4
- data/app/controllers/admin/pictures_controller.rb +13 -18
- data/app/controllers/admin/trash_controller.rb +0 -5
- data/app/controllers/admin/users_controller.rb +2 -3
- data/app/controllers/alchemy_controller.rb +18 -30
- data/app/controllers/pages_controller.rb +21 -24
- data/app/helpers/admin/elements_helper.rb +5 -0
- data/app/helpers/admin/pages_helper.rb +36 -1
- data/app/helpers/alchemy_helper.rb +39 -17
- data/app/models/attachment.rb +2 -2
- data/app/models/essence_file.rb +1 -1
- data/app/models/page.rb +1 -1
- data/app/sweepers/pages_sweeper.rb +10 -0
- data/app/views/admin/attachments/destroy.js.erb +4 -0
- data/app/views/admin/clipboard/insert.js.erb +12 -19
- data/app/views/admin/contents/create.js.erb +1 -1
- data/app/views/admin/contents/destroy.js.erb +7 -0
- data/app/views/admin/contents/order.js.erb +6 -0
- data/app/views/admin/elements/_element.html.erb +4 -2
- data/app/views/admin/elements/create.js.erb +19 -26
- data/app/views/admin/elements/fold.js.erb +1 -1
- data/app/views/admin/elements/index.html.erb +1 -1
- data/app/views/admin/essence_files/assign.js.erb +8 -0
- data/app/views/admin/essence_pictures/save_link.js.erb +3 -0
- data/app/views/admin/index.html.erb +37 -27
- data/app/views/admin/languages/destroy.js.erb +1 -0
- data/app/views/admin/pages/_page.html.erb +1 -1
- data/app/views/admin/pages/_sitemap.html.erb +1 -1
- data/app/views/admin/pages/edit.html.erb +2 -2
- data/app/views/admin/pages/update.js.erb +1 -1
- data/app/views/admin/partials/_upload_form.html.erb +11 -11
- data/app/views/admin/pictures/archive_overlay.js.erb +1 -0
- data/app/views/admin/pictures/flush.js.erb +2 -0
- data/app/views/admin/pictures/update.js.erb +1 -0
- data/app/views/admin/trash/clear.js.erb +3 -0
- data/app/views/alchemy/error_notice.js.erb +1 -0
- data/app/views/alchemy/permission_denied.js.erb +2 -0
- data/app/views/alchemy/redirect.js.erb +1 -0
- data/app/views/alchemy/remote_errors.js.erb +3 -0
- data/app/views/alchemy/update.js.erb +5 -0
- data/app/views/essences/_essence_file_editor.html.erb +0 -1
- data/app/views/essences/_essence_file_view.html.erb +1 -5
- data/app/views/essences/_essence_picture_tools.html.erb +1 -1
- data/app/views/layouts/alchemy.html.erb +22 -9
- data/app/views/pages/show.rss.builder +1 -1
- data/config/alchemy/elements.yml +0 -5
- data/config/alchemy/page_layouts.yml +1 -1
- data/config/asset_packages.yml +17 -19
- data/config/authorization_rules.rb +1 -0
- data/config/locales/de.yml +0 -1
- data/config/routes.rb +1 -1
- data/lib/alchemy/tinymce.rb +51 -0
- data/lib/alchemy/version.rb +3 -3
- data/lib/alchemy_cms.rb +4 -2
- data/script/rails +6 -0
- data/spec/controllers/admin/clipboard_controller_spec.rb +15 -13
- data/spec/controllers/admin/contents_controller_spec.rb +4 -4
- data/spec/controllers/admin/trash_controller_spec.rb +6 -9
- data/spec/controllers/pages_controller_spec.rb +9 -8
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +3 -3
- data/spec/dummy/config/application.rb +12 -6
- data/spec/dummy/config/database.yml +3 -0
- data/spec/dummy/config/environments/development.rb +7 -3
- data/spec/dummy/config/environments/production.rb +23 -12
- data/spec/dummy/config/environments/test.rb +5 -1
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +1 -1
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/factories.rb +8 -8
- data/spec/helpers/admin/elements_helper_spec.rb +2 -2
- data/spec/helpers/contents_helper_spec.rb +1 -1
- data/spec/helpers/elements_helper_spec.rb +6 -6
- data/spec/helpers/essences_helper_spec.rb +1 -1
- data/spec/helpers/pages_helper_spec.rb +37 -37
- data/spec/integration/pages_controller_spec.rb +29 -26
- data/spec/integration/security_spec.rb +2 -1
- data/spec/models/content_spec.rb +1 -1
- data/spec/models/element_spec.rb +11 -11
- data/spec/models/language_spec.rb +5 -5
- data/spec/models/page_spec.rb +54 -54
- data/spec/models/user_spec.rb +2 -1
- data/spec/routing_spec.rb +1 -1
- data/{assets/javascripts/jquery.js → vendor/assets/javascripts/jquery-1.6.2.min.js} +0 -0
- data/{assets/javascripts/jquery-ui.js → vendor/assets/javascripts/jquery-ui-custom-1.8.16.min.js} +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.Jcrop.min.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.dialogextend.min.js +7 -7
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.in-place-edit.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.sb.min.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.scrollTo-1.4.2-min.js +10 -10
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.ui.nestedSortable.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.ui.tabspaging.js +0 -0
- data/{assets → vendor/assets}/javascripts/swfupload/fileprogress.js +202 -202
- data/{assets → vendor/assets}/javascripts/swfupload/handlers.js +171 -171
- data/{assets → vendor/assets}/javascripts/swfupload/queue.js +97 -97
- data/{assets → vendor/assets}/javascripts/swfupload/swfupload.js +980 -980
- data/{assets → vendor/assets}/javascripts/swfupload/swfupload.swf +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/jquery.tinymce.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/license.txt +504 -504
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -110
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -0
- data/{assets/javascripts/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css → vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.erb} +8 -8
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -387
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -36
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -51
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/pastetext.htm +26 -26
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/pasteword.htm +21 -21
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/cell.htm +180 -180
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/cell.css +16 -16
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/row.css +25 -25
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/table.css +13 -13
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/cell.js +319 -319
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/merge_cells.js +27 -27
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/row.js +237 -237
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/table.js +450 -450
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/merge_cells.htm +32 -32
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/row.htm +158 -158
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/table.htm +188 -188
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/about.htm +52 -52
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/anchor.htm +26 -26
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/charmap.htm +51 -51
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/color_picker.htm +74 -74
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/editor_template.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/image.htm +80 -80
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/flash.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/iframe.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/trans.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/video.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/about.js +73 -73
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/anchor.js +43 -43
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/charmap.js +355 -355
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/color_picker.js +329 -329
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/image.js +251 -251
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/link.js +153 -153
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/source_editor.js +56 -56
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/link.htm +57 -57
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/shortcuts.htm +47 -47
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/content.css +50 -50
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +117 -117
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +214 -214
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +48 -48
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +117 -117
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +217 -217
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +7 -7
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -5
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/source_editor.htm +25 -25
- data/{assets → vendor/assets}/javascripts/tiny_mce/tiny_mce.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/tiny_mce_popup.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/editable_selects.js +70 -70
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/form_utils.js +210 -210
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/mctabs.js +161 -161
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/validate.js +252 -252
- metadata +338 -369
- data/app/views/elements/_download_editor.html.erb +0 -1
- data/app/views/elements/_download_view.html.erb +0 -3
- data/assets/javascripts/alchemy.js +0 -903
- data/assets/javascripts/jquery.rails.js +0 -315
- data/assets/stylesheets/ie6.css +0 -18
- data/config/initializers/tinymce_hammer.rb +0 -31
@@ -4,12 +4,12 @@ describe Admin::ContentsController do
|
|
4
4
|
|
5
5
|
before(:each) do
|
6
6
|
activate_authlogic
|
7
|
-
UserSession.create
|
7
|
+
UserSession.create Factory(:admin_user)
|
8
8
|
end
|
9
9
|
|
10
|
-
it "should update a content" do
|
11
|
-
|
12
|
-
|
10
|
+
it "should update a content via ajax" do
|
11
|
+
Factory(:element)
|
12
|
+
post :update, {:id => 1, :content => {:body => 'Peters Petshop'}, :format => :js}
|
13
13
|
Element.first.ingredient('intro').should == "Peters Petshop"
|
14
14
|
end
|
15
15
|
|
@@ -2,19 +2,16 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Admin::TrashController do
|
4
4
|
|
5
|
+
render_views
|
6
|
+
|
5
7
|
before(:each) do
|
6
8
|
activate_authlogic
|
7
|
-
UserSession.create
|
9
|
+
UserSession.create Factory(:admin_user)
|
8
10
|
end
|
9
11
|
|
10
|
-
it "should hold trashed elements" do
|
11
|
-
|
12
|
-
@
|
13
|
-
@element = FactoryGirl.create(:element, :page => @page)
|
14
|
-
# Rails, RSpec and co. are sucking
|
15
|
-
@element.reload
|
16
|
-
@element.trash
|
17
|
-
@element.reload
|
12
|
+
it "should hold trashed elements", :focus => true do
|
13
|
+
@page = Factory(:page, :parent_id => Page.rootpage.id)
|
14
|
+
@element = Factory(:element, :page => nil, :public => false, :position => 0, :folded => true)
|
18
15
|
get :index, :page_id => @page.id
|
19
16
|
response.body.should have_selector('#trash_items #element_4.element_editor')
|
20
17
|
end
|
@@ -2,38 +2,39 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe PagesController do
|
4
4
|
|
5
|
+
render_views
|
6
|
+
|
5
7
|
before(:each) do
|
6
8
|
@default_language = Language.get_default
|
7
|
-
@default_language_root =
|
9
|
+
@default_language_root = Factory(:language_root_page, :language => @default_language, :name => 'Home', :public => true)
|
8
10
|
end
|
9
11
|
|
10
12
|
context "requested for a page containing a feed" do
|
11
13
|
|
12
14
|
before(:each) do
|
13
|
-
@page =
|
15
|
+
@page = Factory(:public_page, :parent_id => @default_language_root.id, :page_layout => 'news', :name => 'News', :language => @default_language)
|
14
16
|
end
|
15
|
-
|
17
|
+
|
16
18
|
it "should render a rss feed" do
|
17
19
|
get :show, :urlname => 'news', :format => :rss
|
18
20
|
response.content_type.should == 'application/rss+xml'
|
19
21
|
end
|
20
|
-
|
22
|
+
|
21
23
|
it "should include content" do
|
22
|
-
pending "I didn't figured out how to test XML response bodies"
|
23
24
|
@page.elements.first.content_by_name('news_headline').essence.update_attributes({:body => 'Peters Petshop'})
|
24
25
|
get :show, :urlname => 'news', :format => :rss
|
25
26
|
response.body.should match /Peters Petshop/
|
26
27
|
end
|
27
|
-
|
28
|
+
|
28
29
|
end
|
29
30
|
|
30
31
|
context "requested for a page that does not contain a feed" do
|
31
|
-
|
32
|
+
|
32
33
|
it "should render xml 404 error" do
|
33
34
|
get :show, :urlname => 'home', :format => :rss
|
34
35
|
response.status.should == 404
|
35
36
|
end
|
36
|
-
|
37
|
+
|
37
38
|
end
|
38
39
|
|
39
40
|
end
|
data/spec/dummy/Rakefile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
+
#!/usr/bin/env rake
|
1
2
|
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
2
3
|
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
3
4
|
|
4
5
|
require File.expand_path('../config/application', __FILE__)
|
5
|
-
require 'rake'
|
6
6
|
|
7
7
|
Dummy::Application.load_tasks
|
@@ -0,0 +1,9 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree .
|
7
|
+
*/
|
File without changes
|
File without changes
|
@@ -2,9 +2,9 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Dummy</title>
|
5
|
-
<%= stylesheet_link_tag
|
6
|
-
<%= javascript_include_tag
|
7
|
-
<%=
|
5
|
+
<%= stylesheet_link_tag "application" %>
|
6
|
+
<%= javascript_include_tag "application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
8
|
</head>
|
9
9
|
<body>
|
10
10
|
|
@@ -1,10 +1,12 @@
|
|
1
1
|
require File.expand_path('../boot', __FILE__)
|
2
2
|
|
3
|
-
|
4
|
-
require "active_record/railtie"
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
require "active_record/railtie"
|
5
5
|
require "action_controller/railtie"
|
6
|
-
require "action_view/railtie"
|
7
6
|
require "action_mailer/railtie"
|
7
|
+
require "active_resource/railtie"
|
8
|
+
require "sprockets/railtie"
|
9
|
+
# require "rails/test_unit/railtie"
|
8
10
|
|
9
11
|
Bundler.require
|
10
12
|
require "alchemy_cms"
|
@@ -33,13 +35,17 @@ module Dummy
|
|
33
35
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
34
36
|
# config.i18n.default_locale = :de
|
35
37
|
|
36
|
-
# JavaScript files you want as :defaults (application.js is always included).
|
37
|
-
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
38
|
-
|
39
38
|
# Configure the default encoding used in templates for Ruby 1.9.
|
40
39
|
config.encoding = "utf-8"
|
41
40
|
|
42
41
|
# Configure sensitive parameters which will be filtered from the log file.
|
43
42
|
config.filter_parameters += [:password]
|
43
|
+
|
44
|
+
# Enable the asset pipeline
|
45
|
+
config.assets.enabled = true
|
46
|
+
|
47
|
+
# Version of your assets, change this if you want to expire all your assets
|
48
|
+
config.assets.version = '1.0'
|
44
49
|
end
|
45
50
|
end
|
51
|
+
|
@@ -3,7 +3,7 @@ Dummy::Application.configure do
|
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
5
|
# every request. This slows down response time but is perfect for development
|
6
|
-
# since you don't have to restart the
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
9
|
# Log error messages when you accidentally call methods on nil.
|
@@ -11,7 +11,6 @@ Dummy::Application.configure do
|
|
11
11
|
|
12
12
|
# Show full error reports and disable caching
|
13
13
|
config.consider_all_requests_local = true
|
14
|
-
config.action_view.debug_rjs = true
|
15
14
|
config.action_controller.perform_caching = false
|
16
15
|
|
17
16
|
# Don't care if the mailer can't send
|
@@ -22,5 +21,10 @@ Dummy::Application.configure do
|
|
22
21
|
|
23
22
|
# Only use best-standards-support built into browsers
|
24
23
|
config.action_dispatch.best_standards_support = :builtin
|
25
|
-
end
|
26
24
|
|
25
|
+
# Do not compress assets
|
26
|
+
config.assets.compress = false
|
27
|
+
|
28
|
+
# Expands the lines which load the assets
|
29
|
+
config.assets.debug = true
|
30
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
Dummy::Application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
|
-
# The production environment is meant for finished, "live" apps.
|
5
4
|
# Code is not reloaded between requests
|
6
5
|
config.cache_classes = true
|
7
6
|
|
@@ -9,14 +8,27 @@ Dummy::Application.configure do
|
|
9
8
|
config.consider_all_requests_local = false
|
10
9
|
config.action_controller.perform_caching = true
|
11
10
|
|
12
|
-
#
|
13
|
-
config.
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
14
22
|
|
15
|
-
#
|
16
|
-
# config.
|
23
|
+
# Defaults to Rails.root.join("public/assets")
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
17
25
|
|
18
|
-
#
|
19
|
-
#
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
20
32
|
|
21
33
|
# See everything in the log (default is :info)
|
22
34
|
# config.log_level = :debug
|
@@ -27,13 +39,12 @@ Dummy::Application.configure do
|
|
27
39
|
# Use a different cache store in production
|
28
40
|
# config.cache_store = :mem_cache_store
|
29
41
|
|
30
|
-
#
|
31
|
-
# In production, Apache or nginx will already do this
|
32
|
-
config.serve_static_assets = false
|
33
|
-
|
34
|
-
# Enable serving of images, stylesheets, and javascripts from an asset server
|
42
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
35
43
|
# config.action_controller.asset_host = "http://assets.example.com"
|
36
44
|
|
45
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
46
|
+
# config.assets.precompile += %w( search.js )
|
47
|
+
|
37
48
|
# Disable delivery errors, bad email addresses will be ignored
|
38
49
|
# config.action_mailer.raise_delivery_errors = false
|
39
50
|
|
@@ -7,7 +7,11 @@ Dummy::Application.configure do
|
|
7
7
|
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
11
15
|
config.whiny_nils = true
|
12
16
|
|
13
17
|
# Show full error reports and disable caching
|
@@ -4,4 +4,4 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
Dummy::Application.config.secret_token = '
|
7
|
+
Dummy::Application.config.secret_token = 'b86ee13015fa1a1238276adbfe8af694f4c204777517b1aa3184c3610e01b3c83f1827363d448c1e8f71bc45ed05529771ef8518da574271fb07ab63dbb315ca'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters :format => [:json]
|
9
|
+
end
|
10
|
+
|
11
|
+
# Disable root element in JSON by default.
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
13
|
+
self.include_root_in_json = false
|
14
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
-
# See
|
2
|
+
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
3
|
|
4
4
|
en:
|
5
5
|
hello: "Hello world"
|
data/spec/dummy/config/routes.rb
CHANGED
@@ -48,7 +48,7 @@ Dummy::Application.routes.draw do
|
|
48
48
|
|
49
49
|
# You can have the root of your site routed with "root"
|
50
50
|
# just remember to delete public/index.html.
|
51
|
-
# root :to =>
|
51
|
+
# root :to => 'welcome#index'
|
52
52
|
|
53
53
|
# See how all your routes lay out with "rake routes"
|
54
54
|
|
File without changes
|
data/spec/factories.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
FactoryGirl.define do
|
2
|
-
|
2
|
+
|
3
3
|
factory :user do
|
4
4
|
email 'john@doe.com'
|
5
5
|
login "jdoe"
|
@@ -23,7 +23,7 @@ FactoryGirl.define do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
factory :language do
|
28
28
|
code "kl"
|
29
29
|
name 'Klingonian'
|
@@ -34,9 +34,9 @@ FactoryGirl.define do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
factory :page do
|
37
|
-
language { Language.find_by_code('kl') ||
|
37
|
+
language { Language.find_by_code('kl') || Factory(:language) }
|
38
38
|
name "A Page"
|
39
|
-
parent_id {
|
39
|
+
parent_id { Factory(:language_root_page).id }
|
40
40
|
page_layout "standard"
|
41
41
|
|
42
42
|
factory :language_root_page do
|
@@ -53,14 +53,14 @@ FactoryGirl.define do
|
|
53
53
|
end
|
54
54
|
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
factory :cell do
|
58
|
-
page { Page.find_by_language_root(true) ||
|
58
|
+
page { Page.find_by_language_root(true) || Factory(:language_root_page) }
|
59
59
|
name "A Cell"
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
factory :element do
|
63
63
|
name 'article'
|
64
64
|
end
|
65
|
-
|
65
|
+
|
66
66
|
end
|
@@ -5,8 +5,8 @@ include AlchemyHelper
|
|
5
5
|
describe Admin::ElementsHelper do
|
6
6
|
|
7
7
|
before(:each) do
|
8
|
-
@page =
|
9
|
-
@element =
|
8
|
+
@page = Factory(:public_page)
|
9
|
+
@element = Factory(:element, :page => @page)
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should render an element editor partial" do
|
@@ -5,8 +5,8 @@ include AlchemyHelper
|
|
5
5
|
describe ElementsHelper do
|
6
6
|
|
7
7
|
before(:each) do
|
8
|
-
@page =
|
9
|
-
@element =
|
8
|
+
@page = Factory(:public_page)
|
9
|
+
@element = Factory(:element, :page => @page)
|
10
10
|
end
|
11
11
|
|
12
12
|
it "should render an element view partial" do
|
@@ -14,18 +14,18 @@ describe ElementsHelper do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should render all elements" do
|
17
|
-
@another_element =
|
17
|
+
@another_element = Factory(:element)
|
18
18
|
helper.stub!(:configuration).and_return(true)
|
19
19
|
helper.render_elements.should match(/id="header_3.+id="article_5"/)
|
20
|
-
end
|
20
|
+
end
|
21
21
|
|
22
22
|
it "should render a unique dom id for element" do
|
23
23
|
helper.element_dom_id(@element).should == "#{@element.name}_#{@element.id}"
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should render elements for a cell" do
|
27
|
-
cell =
|
28
|
-
|
27
|
+
cell = Factory(:cell)
|
28
|
+
Factory(:element, :cell_id => cell.id)
|
29
29
|
helper.stub(:configuration).and_return(true)
|
30
30
|
helper.render_cell_elements(cell).should match(/id="article_7"/)
|
31
31
|
end
|