alchemy_cms 3.3.0.rc1 → 3.3.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (269) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -2
  3. data/Gemfile +1 -0
  4. data/alchemy_cms.gemspec +6 -6
  5. data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +0 -7
  6. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +4 -4
  7. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +51 -5
  8. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +0 -2
  9. data/app/assets/stylesheets/alchemy/elements.scss +2 -2
  10. data/app/controllers/alchemy/admin/elements_controller.rb +2 -0
  11. data/app/controllers/alchemy/admin/pages_controller.rb +11 -3
  12. data/app/controllers/alchemy/admin/pictures_controller.rb +1 -0
  13. data/app/models/alchemy/element.rb +3 -1
  14. data/app/models/alchemy/element/element_contents.rb +2 -7
  15. data/app/models/alchemy/element/presenters.rb +11 -4
  16. data/app/models/alchemy/page.rb +3 -1
  17. data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -1
  18. data/app/views/alchemy/admin/contents/create.js.erb +0 -1
  19. data/app/views/alchemy/admin/elements/_element_header.html.erb +3 -1
  20. data/app/views/alchemy/admin/elements/order.js.erb +25 -10
  21. data/app/views/alchemy/admin/elements/update.js.erb +1 -2
  22. data/app/views/alchemy/admin/essence_files/assign.js.erb +0 -1
  23. data/app/views/alchemy/admin/essence_pictures/assign.js.erb +0 -1
  24. data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +0 -1
  25. data/app/views/alchemy/admin/pages/destroy.js.erb +0 -1
  26. data/app/views/alchemy/admin/pages/update.js.erb +6 -4
  27. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +2 -1
  28. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -7
  29. data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -1
  30. data/bin/alchemy +1 -1
  31. data/bin/rspec +3 -2
  32. data/bin/spring +6 -6
  33. data/config/alchemy/config.yml +6 -1
  34. data/lib/alchemy/seeder.rb +9 -3
  35. data/lib/alchemy/version.rb +1 -1
  36. metadata +6 -471
  37. data/spec/controllers/alchemy/admin/attachments_controller_spec.rb +0 -193
  38. data/spec/controllers/alchemy/admin/base_controller_spec.rb +0 -87
  39. data/spec/controllers/alchemy/admin/clipboard_controller_spec.rb +0 -60
  40. data/spec/controllers/alchemy/admin/contents_controller_spec.rb +0 -78
  41. data/spec/controllers/alchemy/admin/dashboard_controller_spec.rb +0 -144
  42. data/spec/controllers/alchemy/admin/elements_controller_spec.rb +0 -496
  43. data/spec/controllers/alchemy/admin/essence_files_controller_spec.rb +0 -76
  44. data/spec/controllers/alchemy/admin/essence_pictures_controller_spec.rb +0 -202
  45. data/spec/controllers/alchemy/admin/languages_controller_spec.rb +0 -73
  46. data/spec/controllers/alchemy/admin/layoutpages_controller_spec.rb +0 -21
  47. data/spec/controllers/alchemy/admin/pages_controller_spec.rb +0 -639
  48. data/spec/controllers/alchemy/admin/pictures_controller_spec.rb +0 -383
  49. data/spec/controllers/alchemy/admin/resources_controller_spec.rb +0 -81
  50. data/spec/controllers/alchemy/admin/tags_controller_spec.rb +0 -63
  51. data/spec/controllers/alchemy/admin/trash_controller_spec.rb +0 -67
  52. data/spec/controllers/alchemy/api/contents_controller_spec.rb +0 -125
  53. data/spec/controllers/alchemy/api/elements_controller_spec.rb +0 -124
  54. data/spec/controllers/alchemy/api/pages_controller_spec.rb +0 -167
  55. data/spec/controllers/alchemy/attachments_controller_spec.rb +0 -64
  56. data/spec/controllers/alchemy/base_controller_spec.rb +0 -106
  57. data/spec/controllers/alchemy/elements_controller_spec.rb +0 -48
  58. data/spec/controllers/alchemy/messages_controller_spec.rb +0 -204
  59. data/spec/controllers/alchemy/on_page_layout_mixin_spec.rb +0 -330
  60. data/spec/controllers/alchemy/pages_controller_spec.rb +0 -343
  61. data/spec/controllers/alchemy/pictures_controller_spec.rb +0 -415
  62. data/spec/dummy/Rakefile +0 -6
  63. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  64. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  65. data/spec/dummy/app/controllers/admin/events_controller.rb +0 -3
  66. data/spec/dummy/app/controllers/application_controller.rb +0 -15
  67. data/spec/dummy/app/controllers/login_controller.rb +0 -5
  68. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  69. data/spec/dummy/app/mailers/.gitkeep +0 -0
  70. data/spec/dummy/app/models/ability.rb +0 -9
  71. data/spec/dummy/app/models/dummy_model.rb +0 -3
  72. data/spec/dummy/app/models/dummy_user.rb +0 -15
  73. data/spec/dummy/app/models/event.rb +0 -10
  74. data/spec/dummy/app/models/location.rb +0 -3
  75. data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_editor.html.erb +0 -11
  76. data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_view.html.erb +0 -31
  77. data/spec/dummy/app/views/alchemy/elements/_article_editor.html.erb +0 -6
  78. data/spec/dummy/app/views/alchemy/elements/_article_view.html.erb +0 -10
  79. data/spec/dummy/app/views/alchemy/elements/_bild_editor.html.erb +0 -3
  80. data/spec/dummy/app/views/alchemy/elements/_bild_view.html.erb +0 -5
  81. data/spec/dummy/app/views/alchemy/elements/_contactform_editor.html.erb +0 -6
  82. data/spec/dummy/app/views/alchemy/elements/_contactform_view.html.erb +0 -16
  83. data/spec/dummy/app/views/alchemy/elements/_download_editor.html.erb +0 -3
  84. data/spec/dummy/app/views/alchemy/elements/_download_view.html.erb +0 -5
  85. data/spec/dummy/app/views/alchemy/elements/_erb_element_editor.html.erb +0 -3
  86. data/spec/dummy/app/views/alchemy/elements/_erb_element_view.html.erb +0 -5
  87. data/spec/dummy/app/views/alchemy/elements/_header_editor.html.erb +0 -3
  88. data/spec/dummy/app/views/alchemy/elements/_header_view.html.erb +0 -5
  89. data/spec/dummy/app/views/alchemy/elements/_headline_editor.html.erb +0 -1
  90. data/spec/dummy/app/views/alchemy/elements/_headline_view.html.erb +0 -1
  91. data/spec/dummy/app/views/alchemy/elements/_news_editor.html.erb +0 -5
  92. data/spec/dummy/app/views/alchemy/elements/_news_view.html.erb +0 -11
  93. data/spec/dummy/app/views/alchemy/elements/_search_editor.html.erb +0 -1
  94. data/spec/dummy/app/views/alchemy/elements/_search_view.html.erb +0 -4
  95. data/spec/dummy/app/views/alchemy/elements/_slide_editor.html.erb +0 -3
  96. data/spec/dummy/app/views/alchemy/elements/_slide_view.html.erb +0 -5
  97. data/spec/dummy/app/views/alchemy/elements/_slider_editor.html.erb +0 -2
  98. data/spec/dummy/app/views/alchemy/elements/_slider_view.html.erb +0 -4
  99. data/spec/dummy/app/views/alchemy/elements/_text_editor.html.erb +0 -3
  100. data/spec/dummy/app/views/alchemy/elements/_text_view.html.erb +0 -5
  101. data/spec/dummy/app/views/alchemy/page_layouts/_standard.html.erb +0 -15
  102. data/spec/dummy/app/views/layouts/application.html.erb +0 -17
  103. data/spec/dummy/bin/bundle +0 -3
  104. data/spec/dummy/bin/rails +0 -4
  105. data/spec/dummy/bin/rake +0 -4
  106. data/spec/dummy/config.ru +0 -4
  107. data/spec/dummy/config/alchemy/cells.yml +0 -5
  108. data/spec/dummy/config/alchemy/elements.yml +0 -109
  109. data/spec/dummy/config/alchemy/page_layouts.yml +0 -32
  110. data/spec/dummy/config/application.rb +0 -32
  111. data/spec/dummy/config/boot.rb +0 -5
  112. data/spec/dummy/config/database.yml +0 -32
  113. data/spec/dummy/config/environment.rb +0 -5
  114. data/spec/dummy/config/environments/development.rb +0 -41
  115. data/spec/dummy/config/environments/production.rb +0 -77
  116. data/spec/dummy/config/environments/test.rb +0 -43
  117. data/spec/dummy/config/initializers/alchemy.rb +0 -3
  118. data/spec/dummy/config/initializers/assets.rb +0 -11
  119. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  120. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  121. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  122. data/spec/dummy/config/initializers/inflections.rb +0 -16
  123. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  124. data/spec/dummy/config/initializers/secret_token.rb +0 -12
  125. data/spec/dummy/config/initializers/session_store.rb +0 -3
  126. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
  127. data/spec/dummy/config/locales/kl.yml +0 -2
  128. data/spec/dummy/config/routes.rb +0 -12
  129. data/spec/dummy/config/secrets.yml +0 -22
  130. data/spec/dummy/db/migrate/20121026104128_create_events.rb +0 -20
  131. data/spec/dummy/db/migrate/20130328101418_create_locations.rb +0 -9
  132. data/spec/dummy/db/migrate/20130827094554_alchemy_two_point_six.rb +0 -1
  133. data/spec/dummy/db/migrate/20130828121054_remove_do_not_index_from_alchemy_essence_texts.rb +0 -1
  134. data/spec/dummy/db/migrate/20130828121120_remove_do_not_index_from_alchemy_essence_richtexts.rb +0 -1
  135. data/spec/dummy/db/migrate/20130918201742_add_published_at_to_alchemy_pages.rb +0 -1
  136. data/spec/dummy/db/migrate/20131209225243_create_dummy_users.rb +0 -9
  137. data/spec/dummy/db/migrate/20150122213511_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +0 -31
  138. data/spec/dummy/db/migrate/20150122213512_add_missing_unique_indices.acts_as_taggable_on_engine.rb +0 -20
  139. data/spec/dummy/db/migrate/20150122213513_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +0 -15
  140. data/spec/dummy/db/migrate/20150122213514_add_missing_taggable_index.acts_as_taggable_on_engine.rb +0 -10
  141. data/spec/dummy/db/migrate/20150412103152_create_dummy_model.rb +0 -7
  142. data/spec/dummy/db/migrate/20150608204610_add_parent_element_id_to_alchemy_elements.rb +0 -1
  143. data/spec/dummy/db/migrate/20150729151825_add_link_text_to_alchemy_essence_files.rb +0 -1
  144. data/spec/dummy/db/migrate/20150906195818_add_locale_to_alchemy_languages.rb +0 -1
  145. data/spec/dummy/db/schema.rb +0 -326
  146. data/spec/dummy/db/seeds.rb +0 -1
  147. data/spec/dummy/lib/assets/.gitkeep +0 -0
  148. data/spec/dummy/public/404.html +0 -67
  149. data/spec/dummy/public/422.html +0 -67
  150. data/spec/dummy/public/500.html +0 -66
  151. data/spec/dummy/public/favicon.ico +0 -0
  152. data/spec/dummy/spec/javascripts +0 -1
  153. data/spec/factories.rb +0 -13
  154. data/spec/features/admin/admin_layout_spec.rb +0 -14
  155. data/spec/features/admin/dashboard_spec.rb +0 -81
  156. data/spec/features/admin/edit_elements_feature_spec.rb +0 -36
  157. data/spec/features/admin/language_tree_feature_spec.rb +0 -32
  158. data/spec/features/admin/languages_features_spec.rb +0 -65
  159. data/spec/features/admin/legacy_page_url_management_spec.rb +0 -62
  160. data/spec/features/admin/link_overlay_spec.rb +0 -53
  161. data/spec/features/admin/locale_select_feature_spec.rb +0 -25
  162. data/spec/features/admin/modules_integration_spec.rb +0 -23
  163. data/spec/features/admin/navigation_feature_spec.rb +0 -22
  164. data/spec/features/admin/page_creation_feature_spec.rb +0 -51
  165. data/spec/features/admin/page_editing_feature_spec.rb +0 -135
  166. data/spec/features/admin/picture_library_integration_spec.rb +0 -62
  167. data/spec/features/admin/resources_integration_spec.rb +0 -128
  168. data/spec/features/admin/site_select_feature_spec.rb +0 -31
  169. data/spec/features/admin/tinymce_feature_spec.rb +0 -33
  170. data/spec/features/navigation_spec.rb +0 -9
  171. data/spec/features/page_feature_spec.rb +0 -186
  172. data/spec/features/page_redirects_spec.rb +0 -358
  173. data/spec/features/picture_security_spec.rb +0 -29
  174. data/spec/features/security_spec.rb +0 -24
  175. data/spec/features/translation_integration_spec.rb +0 -51
  176. data/spec/fixtures/500x500.png +0 -0
  177. data/spec/fixtures/80x60.png +0 -0
  178. data/spec/fixtures/animated.gif +0 -0
  179. data/spec/fixtures/image with spaces.png +0 -0
  180. data/spec/fixtures/image.png +0 -0
  181. data/spec/fixtures/image2.PNG +0 -0
  182. data/spec/fixtures/image3.jpeg +0 -0
  183. data/spec/helpers/alchemy/admin/attachments_helper_spec.rb +0 -15
  184. data/spec/helpers/alchemy/admin/base_helper_spec.rb +0 -280
  185. data/spec/helpers/alchemy/admin/contents_helper_spec.rb +0 -46
  186. data/spec/helpers/alchemy/admin/elements_helper_spec.rb +0 -314
  187. data/spec/helpers/alchemy/admin/essences_helper_spec.rb +0 -201
  188. data/spec/helpers/alchemy/admin/navigation_helper_spec.rb +0 -294
  189. data/spec/helpers/alchemy/admin/pages_helper_spec.rb +0 -63
  190. data/spec/helpers/alchemy/admin/pictures_helper_spec.rb +0 -28
  191. data/spec/helpers/alchemy/admin/tags_helper_spec.rb +0 -111
  192. data/spec/helpers/alchemy/base_helper_spec.rb +0 -44
  193. data/spec/helpers/alchemy/elements_block_helper_spec.rb +0 -135
  194. data/spec/helpers/alchemy/elements_helper_spec.rb +0 -326
  195. data/spec/helpers/alchemy/essences_helper_spec.rb +0 -85
  196. data/spec/helpers/alchemy/pages_helper_spec.rb +0 -499
  197. data/spec/helpers/alchemy/picture_url_helpers_spec.rb +0 -78
  198. data/spec/helpers/alchemy/url_helper_spec.rb +0 -200
  199. data/spec/javascripts/alchemy/dialog_spec.coffee +0 -82
  200. data/spec/javascripts/alchemy/link_overlay_spec.coffee +0 -25
  201. data/spec/javascripts/alchemy_integration_spec.coffee +0 -3
  202. data/spec/javascripts/fixtures/select.html +0 -3
  203. data/spec/javascripts/helpers/mock-ajax.js +0 -199
  204. data/spec/javascripts/helpers/test_responses/test_responses.js +0 -1
  205. data/spec/javascripts/support/jasmine.yml +0 -29
  206. data/spec/libraries/auth_accessors_spec.rb +0 -40
  207. data/spec/libraries/config_spec.rb +0 -111
  208. data/spec/libraries/controller_actions_spec.rb +0 -133
  209. data/spec/libraries/i18n_spec.rb +0 -37
  210. data/spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb +0 -30
  211. data/spec/libraries/modules_spec.rb +0 -67
  212. data/spec/libraries/mount_point_spec.rb +0 -77
  213. data/spec/libraries/page_layout_spec.rb +0 -150
  214. data/spec/libraries/paths_spec.rb +0 -15
  215. data/spec/libraries/permissions_spec.rb +0 -260
  216. data/spec/libraries/resource_spec.rb +0 -344
  217. data/spec/libraries/resources_helper_spec.rb +0 -193
  218. data/spec/libraries/shell_spec.rb +0 -121
  219. data/spec/libraries/template_tracker_spec.rb +0 -85
  220. data/spec/libraries/tinymce_spec.rb +0 -111
  221. data/spec/libraries/userstamp_spec.rb +0 -10
  222. data/spec/mailers/alchemy/messages_spec.rb +0 -21
  223. data/spec/models/alchemy/attachment_spec.rb +0 -250
  224. data/spec/models/alchemy/cell_spec.rb +0 -101
  225. data/spec/models/alchemy/content_spec.rb +0 -513
  226. data/spec/models/alchemy/element_spec.rb +0 -862
  227. data/spec/models/alchemy/element_to_page_spec.rb +0 -13
  228. data/spec/models/alchemy/essence_boolean_spec.rb +0 -10
  229. data/spec/models/alchemy/essence_date_spec.rb +0 -28
  230. data/spec/models/alchemy/essence_file_spec.rb +0 -40
  231. data/spec/models/alchemy/essence_html_spec.rb +0 -18
  232. data/spec/models/alchemy/essence_link_spec.rb +0 -10
  233. data/spec/models/alchemy/essence_picture_spec.rb +0 -255
  234. data/spec/models/alchemy/essence_richtext_spec.rb +0 -23
  235. data/spec/models/alchemy/essence_select_spec.rb +0 -10
  236. data/spec/models/alchemy/essence_text_spec.rb +0 -110
  237. data/spec/models/alchemy/language_spec.rb +0 -243
  238. data/spec/models/alchemy/legacy_page_url_spec.rb +0 -21
  239. data/spec/models/alchemy/message_spec.rb +0 -55
  240. data/spec/models/alchemy/page_spec.rb +0 -2108
  241. data/spec/models/alchemy/picture_spec.rb +0 -418
  242. data/spec/models/alchemy/site_spec.rb +0 -168
  243. data/spec/models/alchemy/tag_spec.rb +0 -29
  244. data/spec/models/dummy_model_spec.rb +0 -10
  245. data/spec/requests/alchemy/admin/resources_requests_spec.rb +0 -26
  246. data/spec/requests/alchemy/admin/site_requests_spec.rb +0 -19
  247. data/spec/requests/alchemy/site_requests_spec.rb +0 -18
  248. data/spec/requests/alchemy/sitemap_spec.rb +0 -56
  249. data/spec/routing/api_routing_spec.rb +0 -150
  250. data/spec/routing/routing_spec.rb +0 -340
  251. data/spec/spec_helper.rb +0 -90
  252. data/spec/support/ci/install_phantomjs +0 -7
  253. data/spec/support/hint_examples.rb +0 -28
  254. data/spec/support/test_tweaks.rb +0 -31
  255. data/spec/support/transformation_examples.rb +0 -179
  256. data/spec/tasks/helpers_spec.rb +0 -217
  257. data/spec/views/admin/pictures/show_spec.rb +0 -43
  258. data/spec/views/essences/essence_boolean_editor_spec.rb +0 -32
  259. data/spec/views/essences/essence_boolean_view_spec.rb +0 -23
  260. data/spec/views/essences/essence_date_view_spec.rb +0 -38
  261. data/spec/views/essences/essence_file_editor_spec.rb +0 -59
  262. data/spec/views/essences/essence_file_view_spec.rb +0 -77
  263. data/spec/views/essences/essence_html_view_spec.rb +0 -22
  264. data/spec/views/essences/essence_link_view_spec.rb +0 -41
  265. data/spec/views/essences/essence_picture_editor_spec.rb +0 -80
  266. data/spec/views/essences/essence_picture_view_spec.rb +0 -128
  267. data/spec/views/essences/essence_richtext_view_spec.rb +0 -32
  268. data/spec/views/essences/essence_select_view_spec.rb +0 -11
  269. data/spec/views/essences/essence_text_view_spec.rb +0 -51
@@ -1,62 +0,0 @@
1
- # encoding: utf-8
2
- require 'spec_helper'
3
-
4
- describe 'Legacy page url management', type: :feature, js: true do
5
- before do
6
- authorize_user(:as_admin)
7
- end
8
-
9
- let!(:a_page) { create(:alchemy_page) }
10
-
11
- def open_page_properties
12
- visit admin_pages_path
13
- within "#page_#{a_page.id}" do
14
- click_link Alchemy.t(:edit_page_properties)
15
- end
16
- end
17
-
18
- it "lets a user add a page link" do
19
- open_page_properties
20
- click_link 'Links'
21
- fill_in 'legacy_page_url_urlname', with: 'new-urlname'
22
- click_button 'Add'
23
- within '#legacy_page_urls' do
24
- expect(page).to have_content('new-urlname')
25
- end
26
- within '#legacy_urls_label' do
27
- expect(page).to have_content('(1) Link')
28
- end
29
- end
30
-
31
- context 'with wrong url format' do
32
- it "displays error message" do
33
- open_page_properties
34
- click_link 'Links'
35
- fill_in 'legacy_page_url_urlname', with: 'invalid url name'
36
- click_button 'Add'
37
- within '#new_legacy_page_url' do
38
- expect(page).to have_content('URL path is invalid')
39
- end
40
- end
41
- end
42
-
43
- context 'with legacy page url present' do
44
- before do
45
- a_page.legacy_urls.create!(urlname: 'a-page-link')
46
- open_page_properties
47
- click_link '(1) Link'
48
- end
49
-
50
- it "lets a user remove a page link" do
51
- click_link 'Remove'
52
- click_button 'Yes'
53
- within '#legacy_page_urls' do
54
- expect(page).to_not have_content('a-page-link')
55
- expect(page).to have_content(Alchemy.t('No page links for this page found'))
56
- end
57
- within '#legacy_urls_label' do
58
- expect(page).to have_content('(0) Links')
59
- end
60
- end
61
- end
62
- end
@@ -1,53 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Link overlay" do
4
- before do
5
- authorize_user(:as_admin)
6
- end
7
-
8
- context "GUI" do
9
- it "has a tab for linking internal pages" do
10
- visit link_admin_pages_path
11
- within('#overlay_tabs') { expect(page).to have_content('Internal') }
12
- end
13
-
14
- it "has a tab for linking external pages" do
15
- visit link_admin_pages_path
16
- within('#overlay_tabs') { expect(page).to have_content('External') }
17
- end
18
-
19
- it "has a tab for linking files" do
20
- visit link_admin_pages_path
21
- within('#overlay_tabs') { expect(page).to have_content('File') }
22
- end
23
- end
24
-
25
- context "linking internal pages", js: true do
26
- let(:lang_root) do
27
- create(:alchemy_page, :language_root)
28
- end
29
-
30
- before do
31
- create(:alchemy_page, :public, parent_id: lang_root.id)
32
- create(:alchemy_page, :public, parent_id: lang_root.id)
33
- end
34
-
35
- it "should have code to load a tree of internal pages" do
36
- visit link_admin_pages_path
37
- # Doesn't work, because the parent page sets the `dialog` variable in window:
38
- # expect(page).to have_selector('ul#sitemap li a')
39
- expect(page).to have_selector('div#page_selector_container div#sitemap-wrapper')
40
- expect(page).to have_selector('div#page_selector_container script')
41
- end
42
-
43
- it "should not have a link for pages that redirect to external" do
44
- create(:alchemy_page, parent_id: lang_root.id, name: 'Google', urlname: 'http://www.google.com')
45
- allow_any_instance_of(Alchemy::Page).to receive(:definition) do
46
- {'redirects_to_external' => true}
47
- end
48
- visit link_admin_pages_path
49
- expect(page).not_to have_selector('ul#sitemap li div[name="/http-www-google-com"] a')
50
- allow_any_instance_of(Alchemy::Page).to receive(:definition).and_call_original
51
- end
52
- end
53
- end
@@ -1,25 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Locale select' do
4
- let(:a_page) { create(:alchemy_page, :public) }
5
- before do
6
- allow(Alchemy::I18n).to receive(:translation_files).and_return ['alchemy.kl.yml', 'alchemy.jp.yml', 'alchemy.cz.yml']
7
- authorize_user(:as_admin)
8
- end
9
-
10
- it "contains all locales in a selectbox" do
11
- visit admin_dashboard_path
12
- expect(page).to have_select('change_locale', options: ['Kl', 'Jp', 'Cz'])
13
- end
14
-
15
- context 'when having available_locales set for Alchemy::I18n' do
16
- before do
17
- allow(Alchemy::I18n).to receive(:available_locales).and_return [:jp, :cz]
18
- end
19
-
20
- it "provides only that locales" do
21
- visit admin_dashboard_path
22
- expect(page).to have_select('change_locale', options: ['Jp', 'Cz'])
23
- end
24
- end
25
- end
@@ -1,23 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Modules" do
4
- context "A custom module with a main-apps controller" do
5
- before { authorize_user(:as_admin) }
6
-
7
- it "should have a button in main_navigation, pointing to the configured controller" do
8
- Alchemy::Modules.register_module(
9
- {
10
- name: 'events',
11
- navigation: {
12
- icon: 'icon events',
13
- name: 'Events',
14
- controller: '/admin/events',
15
- action: 'index'
16
- }
17
- })
18
- visit '/admin'
19
- click_on 'Events'
20
- expect(page).not_to have_content('Upps!')
21
- end
22
- end
23
- end
@@ -1,22 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Admin navigation feature' do
4
- context 'admin users' do
5
- before { authorize_user(:as_admin) }
6
-
7
- it "can leave the admin area" do
8
- visit '/admin/leave'
9
- expect(page).to have_content('You are about to leave Alchemy')
10
- end
11
- end
12
-
13
- context 'editor users' do
14
- before { authorize_user(:as_editor) }
15
-
16
- it "can access the languages page" do
17
- visit '/admin'
18
- click_on 'Languages'
19
- expect(current_path).to eq('/admin/languages')
20
- end
21
- end
22
- end
@@ -1,51 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Alchemy
4
- describe "Page creation" do
5
- before { authorize_user(:as_admin) }
6
-
7
- describe "overlay GUI" do
8
- context "without having a Page in the clipboard" do
9
- it "does not contain tabs" do
10
- visit new_admin_page_path
11
- within('#main_content') { expect(page).to_not have_selector('#overlay_tabs') }
12
- end
13
- end
14
-
15
- context "when having a Page in the clipboard" do
16
- before do
17
- expect(Page).to receive(:all_from_clipboard_for_select).and_return [build_stubbed(:alchemy_page)]
18
- end
19
-
20
- it "contains tabs for creating a new page and pasting from clipboard" do
21
- visit new_admin_page_path
22
- within('#overlay_tabs') { expect(page).to have_selector '#create_page_tab, #paste_page_tab' }
23
- end
24
-
25
- context "", js: true do
26
- before do
27
- visit admin_pages_path
28
- page.first(:link, 'Create a new subpage').click
29
- end
30
-
31
- it "the create page tab is visible by default" do
32
- within('#overlay_tabs') do
33
- expect(page).to have_selector('#create_page_tab', visible: true)
34
- expect(page).to have_selector('#paste_page_tab')
35
- end
36
- end
37
-
38
- context "when clicking on an inactive tab" do
39
- it "shows that clicked tab" do
40
- within('#overlay_tabs') do
41
- click_link('Paste from clipboard')
42
- expect(find('#create_page_tab')).to_not be_visible
43
- expect(find('#paste_page_tab')).to be_visible
44
- end
45
- end
46
- end
47
- end
48
- end
49
- end
50
- end
51
- end
@@ -1,135 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe 'Page editing feature' do
4
- let(:a_page) { create(:alchemy_page) }
5
-
6
- context 'as author' do
7
- before { authorize_user(:as_author) }
8
-
9
- it 'cannot publish page.' do
10
- visit alchemy.edit_admin_page_path(a_page)
11
- expect(page).to_not have_selector('#publish_page_form')
12
- end
13
- end
14
-
15
- context 'as editor' do
16
- before { authorize_user(:as_editor) }
17
-
18
- it 'can publish page.' do
19
- visit alchemy.edit_admin_page_path(a_page)
20
- find('#publish_page_form button').click
21
- expect(page).to have_content Alchemy.t(:page_published, name: a_page.name)
22
- end
23
-
24
- context 'while editing a global page' do
25
- let(:a_page) { create(:alchemy_page, layoutpage: true) }
26
-
27
- it 'cannot publish page.' do
28
- visit alchemy.edit_admin_page_path(a_page)
29
- expect(page).to_not have_selector('#publish_page_form')
30
- end
31
- end
32
- end
33
-
34
- context 'as admin' do
35
- let(:a_page) { create(:alchemy_page, :public, visible: true) }
36
-
37
- before { authorize_user(:as_admin) }
38
-
39
- context "in configure overlay" do
40
- context "when editing a normal page" do
41
- it "should show all relevant input fields" do
42
- visit alchemy.configure_admin_page_path(a_page)
43
- expect(page).to have_selector('input#page_urlname')
44
- expect(page).to have_selector('input#page_title')
45
- expect(page).to have_selector('input#page_robot_index')
46
- expect(page).to have_selector('input#page_robot_follow')
47
- end
48
-
49
- context "with sitemaps show_flag config option set to true" do
50
- before do
51
- allow(Alchemy::Config).to receive(:get) do |arg|
52
- arg == :sitemap ? {'show_flag' => true} : Alchemy::Config.show[arg.to_s]
53
- end
54
- end
55
-
56
- it "should show sitemap checkbox" do
57
- visit alchemy.configure_admin_page_path(a_page)
58
- expect(page).to have_selector('input[type="checkbox"]#page_sitemap')
59
- end
60
- end
61
-
62
- context "with sitemaps show_flag config option set to false" do
63
- before do
64
- allow(Alchemy::Config).to receive(:get) do |arg|
65
- arg == :sitemap ? {'show_flag' => false} : Alchemy::Config.show[arg.to_s]
66
- end
67
- end
68
-
69
- it "should not show sitemap checkbox" do
70
- visit alchemy.configure_admin_page_path(a_page)
71
- expect(page).to_not have_selector('input[type="checkbox"]#page_sitemap')
72
- end
73
- end
74
- end
75
-
76
- context "when editing a global page" do
77
- let(:layout_page) { create(:alchemy_page, layoutpage: true) }
78
-
79
- it "should not show the input fields for normal pages" do
80
- visit alchemy.edit_admin_layoutpage_path(layout_page)
81
- expect(page).to_not have_selector('input#page_urlname')
82
- expect(page).to_not have_selector('input#page_title')
83
- expect(page).to_not have_selector('input#page_robot_index')
84
- expect(page).to_not have_selector('input#page_robot_follow')
85
- end
86
- end
87
-
88
- context "when page is taggable" do
89
- before do
90
- expect_any_instance_of(Alchemy::Page)
91
- .to receive(:taggable?).and_return(true)
92
- end
93
-
94
- it "should show the tag_list input field" do
95
- visit alchemy.configure_admin_page_path(a_page)
96
- expect(page).to have_selector('input#page_tag_list')
97
- end
98
- end
99
- end
100
-
101
- context "in preview frame" do
102
- it "the menubar does not render on the page" do
103
- visit alchemy.admin_page_path(a_page)
104
- expect(page).not_to have_selector('#alchemy_menubar')
105
- end
106
-
107
- it "navigation links are not clickable" do
108
- visit alchemy.admin_page_path(a_page)
109
- within('#navigation') do
110
- expect(page).to have_selector('a[href="javascript: void(0)"]')
111
- end
112
- end
113
- end
114
-
115
- context 'in element panel' do
116
- let!(:everything_page) do
117
- create(:alchemy_page, page_layout: 'everything', do_not_autogenerate: false)
118
- end
119
-
120
- it "renders essence editors for all elements" do
121
- visit alchemy.admin_elements_path(page_id: everything_page.id)
122
-
123
- expect(page).to have_selector('div.content_editor.essence_boolean')
124
- expect(page).to have_selector('div.content_editor.essence_date')
125
- expect(page).to have_selector('div.content_editor.essence_file')
126
- expect(page).to have_selector('div.content_editor.essence_html_editor')
127
- expect(page).to have_selector('div.content_editor.essence_link')
128
- expect(page).to have_selector('div.content_editor.essence_picture_editor')
129
- expect(page).to have_selector('div.content_editor.essence_richtext')
130
- expect(page).to have_selector('div.content_editor.essence_select')
131
- expect(page).to have_selector('div.content_editor.essence_text')
132
- end
133
- end
134
- end
135
- end
@@ -1,62 +0,0 @@
1
- require 'spec_helper'
2
-
3
- RSpec.feature "Picture Library" do
4
- before do
5
- authorize_user(:as_admin)
6
- end
7
-
8
- describe "Tagging" do
9
- let!(:picture_1) { create(:alchemy_picture, tag_list: 'tag1', name: 'TaggedWith1') }
10
- let!(:picture_2) { create(:alchemy_picture, tag_list: 'tag2', name: 'TaggedWith2') }
11
-
12
- scenario "it's possible to filter tags by clicking on its name in the tag list." do
13
- visit alchemy.admin_pictures_path
14
-
15
- click_on 'tag1 (1)'
16
-
17
- expect(page).to have_content('TaggedWith1')
18
- expect(page).not_to have_content('TaggedWith2')
19
- end
20
-
21
- scenario "it's possible to undo tag filtering by clicking on an active tag name" do
22
- visit alchemy.admin_pictures_path
23
-
24
- click_on 'tag1 (1)'
25
-
26
- expect(page).to have_content('TaggedWith1')
27
- expect(page).not_to have_content('TaggedWith2')
28
-
29
- click_on 'tag1 (1)'
30
-
31
- expect(page).to have_content('TaggedWith1')
32
- expect(page).to have_content('TaggedWith2')
33
- end
34
-
35
- scenario "it's possible to tighten the tag scope by clicking on another tag name." do
36
- visit alchemy.admin_pictures_path
37
-
38
- click_on 'tag1 (1)'
39
- click_on 'tag2 (1)'
40
-
41
- expect(page).to have_content("You don't have any images in your archive")
42
- end
43
- end
44
-
45
- describe "Filter by tag" do
46
- let!(:picture) { create(:alchemy_picture, tag_list: 'bla') }
47
-
48
- scenario "lists all applied tags." do
49
- visit alchemy.admin_pictures_path
50
-
51
- expect(page).to have_content('bla')
52
- end
53
-
54
- scenario "it's possible to filter pictures by tag." do
55
- visit alchemy.admin_pictures_path
56
-
57
- click_on 'bla (1)'
58
-
59
- expect(page).to have_content('bla')
60
- end
61
- end
62
- end
@@ -1,128 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe "Resources" do
4
- let(:event) { create(:event) }
5
- let(:second_event) { create(:event, name: 'My second Event', entrance_fee: 12.32) }
6
-
7
- before { authorize_user(:as_admin) }
8
-
9
- describe "index view" do
10
- it "should have a button for creating a new resource items" do
11
- visit '/admin/events'
12
- expect(page).to have_selector('#toolbar div.button_with_label a.icon_button span.icon.create')
13
- end
14
-
15
- it "should list existing items" do
16
- event
17
- second_event
18
- visit '/admin/events'
19
- expect(page).to have_content("My Event")
20
- expect(page).to have_content("something fancy")
21
- expect(page).to have_content("12.32")
22
- end
23
-
24
- it "should list existing resource-items nicely formatted" do
25
- event
26
- visit '/admin/events'
27
- expect(page).to have_selector('div#archive_all table.list')
28
- end
29
- end
30
-
31
- describe "form for creating and updating items" do
32
- it "renders an input field according to the attribute's type" do
33
- visit '/admin/events/new'
34
- expect(page).to have_selector('input#event_name[type="text"]')
35
- expect(page).to have_selector('input#event_starts_at[type="date"]')
36
- expect(page).to have_selector('textarea#event_description')
37
- expect(page).to have_selector('input#event_published[type="checkbox"]')
38
- expect(page).to have_selector('input#event_lunch_starts_at_1i[type="hidden"]')
39
- expect(page).to have_selector('input#event_lunch_starts_at_2i[type="hidden"]')
40
- expect(page).to have_selector('input#event_lunch_starts_at_3i[type="hidden"]')
41
- expect(page).to have_selector('select#event_lunch_starts_at_4i')
42
- expect(page).to have_selector('select#event_lunch_starts_at_5i')
43
- end
44
-
45
- it "should have a select box for associated models" do
46
- visit '/admin/events/new'
47
- within('form') do
48
- expect(page).to have_selector('select')
49
- end
50
- end
51
- end
52
-
53
- describe "create resource item" do
54
- context "when form filled with valid data" do
55
- before do
56
- visit '/admin/events/new'
57
- fill_in 'event_name', with: 'My second event'
58
- fill_in 'event_starts_at', with: DateTime.new(2012, 03, 03, 20, 00)
59
- click_on 'Save'
60
- end
61
-
62
- it "lists the new item" do
63
- expect(page).to have_content "My second event"
64
- expect(page).to have_content "03 Mar 2012"
65
- end
66
-
67
- it "shows a success message" do
68
- expect(page).to have_content("Succesfully created")
69
- end
70
- end
71
-
72
- context "when form filled with invalid data" do
73
- before do
74
- visit '/admin/events/new'
75
- fill_in 'event_name', with: '' # invalid!
76
- click_on 'Save'
77
- end
78
-
79
- it "shows the form again" do
80
- expect(page).to have_selector "form input#event_name"
81
- end
82
-
83
- it "lists invalid fields" do
84
- expect(page).to have_content("can't be blank")
85
- end
86
-
87
- it "should not display success notice" do
88
- expect(page).not_to have_content("successfully created")
89
- end
90
- end
91
- end
92
-
93
- describe "updating an item" do
94
- before do
95
- visit("/admin/events/#{event.id}/edit")
96
- fill_in 'event_name', with: 'New event name'
97
- click_on 'Save'
98
- end
99
-
100
- it "shows the updated value" do
101
- expect(page).to have_content("New event name")
102
- end
103
-
104
- it "shows a success message" do
105
- expect(page).to have_content("Succesfully updated")
106
- end
107
- end
108
-
109
- describe "destroying an item" do
110
- before do
111
- event
112
- second_event
113
- visit '/admin/events'
114
- within('tr', text: 'My second Event') do
115
- click_on 'Delete'
116
- end
117
- end
118
-
119
- it "shouldn't be on the list anymore" do
120
- expect(page).to have_content "My Event"
121
- expect(page).not_to have_content "My second Event"
122
- end
123
-
124
- it "should display success message" do
125
- expect(page).to have_content("Succesfully removed")
126
- end
127
- end
128
- end