keppler 2.1.6 → 2.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/installer/core/app/views/admin/layouts/_sidebar.html.haml +2 -2
  4. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/application.js +0 -6
  5. data/installer/core/rockets/keppler_frontend/app/assets/stylesheets/keppler_frontend/app/application.scss +2 -6
  6. data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/admin/views_controller.rb +4 -3
  7. data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/app/app_controller.rb +0 -8
  8. data/installer/core/rockets/keppler_frontend/app/controllers/keppler_frontend/concerns/services.rb +14 -0
  9. data/installer/core/rockets/keppler_frontend/app/models/keppler_frontend/view.rb +0 -1
  10. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/file_format.rb +29 -0
  11. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/resources.rb +70 -0
  12. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/editor/resources_format.rb +63 -0
  13. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/utils/file_format.rb +44 -0
  14. data/installer/core/rockets/keppler_frontend/app/views/keppler_frontend/admin/multimedia/index.html.haml +5 -5
  15. data/installer/core/rockets/keppler_frontend/app/views/layouts/keppler_frontend/app/layouts/_head.html.haml +0 -2
  16. data/installer/core/rockets/keppler_frontend/app/views/layouts/keppler_frontend/app/layouts/application.html.erb +2 -2
  17. data/installer/core/rockets/keppler_frontend/app/views/layouts/themes/keppler_default/application.html.erb +1 -1
  18. data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/editor_spec.rb +20 -0
  19. data/installer/core/spec/controllers/keppler_frontend/admin/views_controller/live_editor_save_spec.rb +10 -10
  20. data/installer/core/spec/fixtures/keppler_frontend/editor/test.html +16 -0
  21. data/installer/core/spec/fixtures/keppler_frontend/editor/test.png +0 -0
  22. data/installer/core/spec/models/keppler_frontend/view/live_editor_spec.rb +54 -54
  23. data/installer/core/spec/routing/keppler_frontend/views_spec.rb +15 -7
  24. data/installer/core/spec/services/keppler_frontend/editor/file_format_spec.rb +35 -0
  25. data/installer/core/spec/services/keppler_frontend/editor/resources_format_spec.rb +45 -0
  26. data/installer/core/spec/services/keppler_frontend/editor/resources_spec.rb +44 -0
  27. data/installer/core/spec/services/keppler_frontend/utils/code_search_spec.rb +4 -5
  28. data/installer/core/spec/services/keppler_frontend/utils/file_format_spec.rb +52 -0
  29. data/installer/core/spec/services/keppler_frontend/utils/yml_handle_spec.rb +15 -12
  30. data/installer/core/spec/spec_helper.rb +2 -0
  31. data/installer/core/test/run.sh +1 -1
  32. data/lib/keppler/version.rb +1 -1
  33. metadata +14 -7400
  34. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-accordion.html +0 -56
  35. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-alert.html +0 -18
  36. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-button-group.html +0 -15
  37. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-button.html +0 -15
  38. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-checks.html +0 -23
  39. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-collapse.html +0 -23
  40. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-12.html +0 -59
  41. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-2.html +0 -29
  42. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-3.html +0 -32
  43. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-4.html +0 -35
  44. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-columns-6.html +0 -41
  45. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-container.html +0 -15
  46. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-dropdown-btn.html +0 -22
  47. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-form.html +0 -33
  48. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-jumbotron.html +0 -25
  49. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-label.html +0 -13
  50. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-list-group.html +0 -22
  51. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-modal.html +0 -32
  52. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-navbar.html +0 -71
  53. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-pagination.html +0 -31
  54. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-panel-table.html +0 -48
  55. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-panel.html +0 -19
  56. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-progress-bar.html +0 -17
  57. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-radio.html +0 -23
  58. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-table.html +0 -42
  59. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-tabs.html +0 -34
  60. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-textarea.html +0 -13
  61. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-thumbnail.html +0 -23
  62. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/bstp-well.html +0 -13
  63. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/bootstrap/btsp-input.html +0 -13
  64. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-blur-parallax.html +0 -59
  65. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-blur.html +0 -58
  66. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-parallax.html +0 -49
  67. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-static.html +0 -48
  68. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-banner-video.html +0 -54
  69. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-block.html +0 -15
  70. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h1.html +0 -13
  71. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h2.html +0 -13
  72. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h3.html +0 -13
  73. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-h4.html +0 -13
  74. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/keppler/kppl-small.html +0 -13
  75. data/installer/core/rockets/keppler_frontend/app/assets/html/keppler_frontend/app/slick/slick-basic.html +0 -43
  76. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapes-custom-code.js +0 -3
  77. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapes-editor.js +0 -1174
  78. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapes-format.js +0 -498
  79. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapes-gradient.js +0 -2
  80. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapes.js +0 -53138
  81. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapesjs-custom-code.min.js.map +0 -1
  82. data/installer/core/rockets/keppler_frontend/app/assets/javascripts/keppler_frontend/app/grapes/grapick.js +0 -2
  83. data/installer/core/rockets/keppler_frontend/app/assets/stylesheets/keppler_frontend/app/grapes/font-awesome.css +0 -4
  84. data/installer/core/rockets/keppler_frontend/app/assets/stylesheets/keppler_frontend/app/grapes/grapes-custom.scss +0 -610
  85. data/installer/core/rockets/keppler_frontend/app/assets/stylesheets/keppler_frontend/app/grapes/grapes.scss +0 -2
  86. data/installer/core/rockets/keppler_frontend/app/assets/stylesheets/keppler_frontend/app/grapes/grapick.scss +0 -1
  87. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/components_handler.rb +0 -41
  88. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/css/convert.rb +0 -28
  89. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/css_handler.rb +0 -44
  90. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/editor.rb +0 -48
  91. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/html_handler.rb +0 -73
  92. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/html_save_utils.rb +0 -43
  93. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/images_handler.rb +0 -31
  94. data/installer/core/rockets/keppler_frontend/app/services/keppler_frontend/live_editor/no_edit_area.rb +0 -67
  95. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000020e7930>.yml +0 -1
  96. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000004f35968>.yml +0 -1
  97. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000005dff430>.yml +0 -1
  98. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000062d44b0>.yml +0 -1
  99. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006306690>.yml +0 -1
  100. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000064d22f8>.yml +0 -1
  101. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006501580>.yml +0 -1
  102. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000067c5d70>.yml +0 -1
  103. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000691b760>.yml +0 -1
  104. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006998918>.yml +0 -1
  105. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000069bf068>.yml +0 -1
  106. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006a4fd48>.yml +0 -1
  107. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006b36bd0>.yml +0 -1
  108. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006ba2bc8>.yml +0 -1
  109. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006d9e530>.yml +0 -1
  110. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006e43d50>.yml +0 -1
  111. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006e7e180>.yml +0 -1
  112. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006f765d8>.yml +0 -1
  113. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006fa5590>.yml +0 -1
  114. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006fa6e40>.yml +0 -1
  115. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000006fca958>.yml +0 -1
  116. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007019788>.yml +0 -1
  117. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007071230>.yml +0 -1
  118. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000070bef58>.yml +0 -1
  119. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000718e730>.yml +0 -1
  120. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000728c4e8>.yml +0 -1
  121. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000072e1948>.yml +0 -1
  122. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000073fd200>.yml +0 -1
  123. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000074220f0>.yml +0 -1
  124. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000074762e0>.yml +0 -1
  125. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000750b548>.yml +0 -1
  126. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000750de10>.yml +0 -1
  127. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007553460>.yml +0 -1
  128. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000075a58a0>.yml +0 -1
  129. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000075e0400>.yml +0 -1
  130. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000075f3b18>.yml +0 -1
  131. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000767c828>.yml +0 -1
  132. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000076825e8>.yml +0 -1
  133. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000076c1310>.yml +0 -1
  134. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000077bc080>.yml +0 -1
  135. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000078595b0>.yml +0 -1
  136. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007a274a0>.yml +0 -1
  137. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007a3be78>.yml +0 -1
  138. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007acc4f0>.yml +0 -1
  139. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007b669d8>.yml +0 -1
  140. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007bcd1d8>.yml +0 -1
  141. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007cb0398>.yml +0 -1
  142. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007cea548>.yml +0 -1
  143. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007d60a68>.yml +0 -1
  144. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007d89490>.yml +0 -1
  145. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007e4bdb0>.yml +0 -1
  146. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007eb3c58>.yml +0 -1
  147. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007ef6198>.yml +0 -1
  148. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007f728b0>.yml +0 -1
  149. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007f7e228>.yml +0 -1
  150. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007f820d0>.yml +0 -1
  151. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000007fca8f8>.yml +0 -1
  152. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000800b5d8>.yml +0 -1
  153. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008048730>.yml +0 -1
  154. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000080a5bd8>.yml +0 -1
  155. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000080bc360>.yml +0 -1
  156. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000080c6c20>.yml +0 -1
  157. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000080ece98>.yml +0 -1
  158. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008102090>.yml +0 -1
  159. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000811d1b0>.yml +0 -1
  160. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000081773e0>.yml +0 -1
  161. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008182a60>.yml +0 -1
  162. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000081bd7f0>.yml +0 -1
  163. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000082311a0>.yml +0 -1
  164. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000828de00>.yml +0 -1
  165. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008396e00>.yml +0 -1
  166. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008452a88>.yml +0 -1
  167. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000085ab218>.yml +0 -1
  168. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008628970>.yml +0 -1
  169. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000867d2e0>.yml +0 -1
  170. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008681430>.yml +0 -1
  171. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000086c38f8>.yml +0 -1
  172. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000878ed50>.yml +0 -1
  173. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000087d1150>.yml +0 -1
  174. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000880e000>.yml +0 -1
  175. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x000000000881dca8>.yml +0 -1
  176. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008841d60>.yml +0 -1
  177. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008846450>.yml +0 -1
  178. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008894510>.yml +0 -1
  179. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000089c1a50>.yml +0 -1
  180. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000008b38b18>.yml +0 -1
  181. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000090a0650>.yml +0 -1
  182. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000090e9418>.yml +0 -1
  183. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000091dae30>.yml +0 -1
  184. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000092907f8>.yml +0 -1
  185. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000092ba170>.yml +0 -1
  186. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000093bfd40>.yml +0 -1
  187. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000009449180>.yml +0 -1
  188. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000094656a0>.yml +0 -1
  189. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000009527f48>.yml +0 -1
  190. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000095d4e78>.yml +0 -1
  191. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000095e0b60>.yml +0 -1
  192. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x0000000009661710>.yml +0 -1
  193. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000096c0350>.yml +0 -1
  194. data/installer/core/rockets/keppler_frontend/config/data/#<KepplerFrontend::View::ActiveRecord_Relation:0x00000000097c1f88>.yml +0 -1
  195. data/installer/core/rockets/keppler_frontend/config/views.yml +0 -18
  196. data/installer/core/spec/services/keppler_frontend/live_editor/components_output_spec.rb +0 -20
  197. data/installer/core/spec/services/keppler_frontend/live_editor/css/convert_spec.rb +0 -39
  198. data/installer/core/spec/services/keppler_frontend/live_editor/css_handler_spec.rb +0 -31
  199. data/installer/core/spec/services/keppler_frontend/live_editor/html_save_spec.rb +0 -75
  200. data/installer/core/spec/services/keppler_frontend/live_editor/html_save_utils_spec.rb +0 -49
  201. data/installer/core/spec/services/keppler_frontend/live_editor/image_output_spec.rb +0 -19
  202. data/installer/core/spec/services/keppler_frontend/live_editor/no_edit_area_spec.rb +0 -44
  203. data/installer/core/spec/services/keppler_frontend/live_editor/render_spec.rb +0 -47
  204. data/installer/core/spec/services/keppler_frontend/live_editor/save_spec.rb +0 -36
@@ -0,0 +1,16 @@
1
+ <keppler-header>
2
+ <keppler-no-edit id="area_one">
3
+ <%= 'area_one' %>
4
+ </keppler-no-edit>
5
+ </keppler-header>
6
+ <keppler-view id="test_index">
7
+ <keppler-no-edit id="area_two">
8
+ <%= 'area_two' %>
9
+ </keppler-no-edit>
10
+ </keppler-view>
11
+ <keppler-footer>
12
+ <keppler-no-edit id="area_three">
13
+ <%= 'area_three' %>
14
+ </keppler-no-edit>
15
+ </keppler-footer>
16
+
@@ -4,59 +4,59 @@ require 'byebug'
4
4
  RSpec.describe KepplerFrontend::View, type: :model do
5
5
 
6
6
  context 'live editor' do
7
- context 'render' do
8
- before(:each) do
9
- @view = create(:keppler_frontend_views, method: "GET")
10
- @view.install
11
- @editor = @view.live_editor_render
12
- end
13
-
14
- it { expect(@editor.count).to eq(5) }
15
-
16
- it { expect(@editor[:view_id]).not_to eq(nil) }
17
- it { expect(@editor[:view_id]).to be_a(Numeric) }
18
-
19
- it { expect(@editor[:view_name]).not_to eq(nil) }
20
- it { expect(@editor[:view_name]).not_to eq('') }
21
- it { expect(@editor[:view_name]).to be_a(String) }
22
-
23
- it { expect(@editor[:css_style]).not_to eq(nil) }
24
- it { expect(@editor[:css_style]).not_to eq('') }
25
- it { expect(@editor[:css_style]).to be_a(String) }
26
-
27
- it { expect(@editor[:images_assets]).not_to eq(nil) }
28
- it { expect(@editor[:images_assets]).not_to eq([]) }
29
- it { expect(@editor[:images_assets]).to be_a(Array) }
30
-
31
- it { expect(@editor[:components]).not_to eq(nil) }
32
- it { expect(@editor[:components]).not_to eq([]) }
33
- it { expect(@editor[:components]).to be_a(Array) }
34
-
35
- after(:each) do
36
- @view.uninstall
37
- end
38
- end
39
-
40
- context 'save' do
41
- let(:html_code) { "<keppler-header>\n<h1>Header Edited</h1>\n</keppler-header>\n<keppler-view id=\"test_index\">\n <h1>Test Index Edited</h1>\n <keppler-no-edit id=\"area_two\">\n <p>area_two</p>\n </keppler-no-edit>\n</keppler-view>\n\n<keppler-footer>\n<h1>Footer Edited</h1>\n</keppler-footer>" }
42
- let(:css_code) { ".h1 { color: red; }" }
43
- let(:front) { KepplerFrontend::Urls::Front.new }
44
-
45
- before(:each) do
46
- @layout_original = File.read(front.layout)
47
- @view = create(:keppler_frontend_views, method: "GET")
48
- @view.install
49
- @result = @view.live_editor_save(html_code, css_code)
50
- end
51
-
52
- it { expect(@result).to eq(true) }
53
-
54
- after(:each) do
55
- @view.uninstall
56
- out_file = File.open(front.layout, "w")
57
- out_file.puts(@layout_original);
58
- out_file.close
59
- end
60
- end
7
+ # context 'render' do
8
+ # before(:each) do
9
+ # @view = create(:keppler_frontend_views, method: "GET")
10
+ # @view.install
11
+ # @editor = @view.live_editor_render
12
+ # end
13
+
14
+ # it { expect(@editor.count).to eq(5) }
15
+
16
+ # it { expect(@editor[:view_id]).not_to eq(nil) }
17
+ # it { expect(@editor[:view_id]).to be_a(Numeric) }
18
+
19
+ # it { expect(@editor[:view_name]).not_to eq(nil) }
20
+ # it { expect(@editor[:view_name]).not_to eq('') }
21
+ # it { expect(@editor[:view_name]).to be_a(String) }
22
+
23
+ # it { expect(@editor[:css_style]).not_to eq(nil) }
24
+ # it { expect(@editor[:css_style]).not_to eq('') }
25
+ # it { expect(@editor[:css_style]).to be_a(String) }
26
+
27
+ # it { expect(@editor[:images_assets]).not_to eq(nil) }
28
+ # it { expect(@editor[:images_assets]).not_to eq([]) }
29
+ # it { expect(@editor[:images_assets]).to be_a(Array) }
30
+
31
+ # it { expect(@editor[:components]).not_to eq(nil) }
32
+ # it { expect(@editor[:components]).not_to eq([]) }
33
+ # it { expect(@editor[:components]).to be_a(Array) }
34
+
35
+ # after(:each) do
36
+ # @view.uninstall
37
+ # end
38
+ # end
39
+
40
+ # context 'save' do
41
+ # let(:html_code) { "<keppler-header>\n<h1>Header Edited</h1>\n</keppler-header>\n<keppler-view id=\"test_index\">\n <h1>Test Index Edited</h1>\n <keppler-no-edit id=\"area_two\">\n <p>area_two</p>\n </keppler-no-edit>\n</keppler-view>\n\n<keppler-footer>\n<h1>Footer Edited</h1>\n</keppler-footer>" }
42
+ # let(:css_code) { ".h1 { color: red; }" }
43
+ # let(:front) { KepplerFrontend::Urls::Front.new }
44
+
45
+ # before(:each) do
46
+ # @layout_original = File.read(front.layout)
47
+ # @view = create(:keppler_frontend_views, method: "GET")
48
+ # @view.install
49
+ # @result = @view.live_editor_save(html_code, css_code)
50
+ # end
51
+
52
+ # it { expect(@result).to eq(true) }
53
+
54
+ # after(:each) do
55
+ # @view.uninstall
56
+ # out_file = File.open(front.layout, "w")
57
+ # out_file.puts(@layout_original);
58
+ # out_file.close
59
+ # end
60
+ # end
61
61
  end
62
62
  end
@@ -5,13 +5,13 @@ RSpec.describe 'routing to views', type: :routing do
5
5
  @view = create(:keppler_frontend_views, method: "GET")
6
6
  end
7
7
 
8
- it 'routes POST /live_editor/save to keppler_frontend/admin/views#live_editor_save' do
9
- expect(post: "/admin/frontend/views/#{@view.id}/live_editor/save").to route_to(
10
- controller: 'keppler_frontend/admin/views',
11
- action: 'live_editor_save',
12
- view_id: @view.id.to_s
13
- )
14
- end
8
+ # it 'routes POST /live_editor/save to keppler_frontend/admin/views#live_editor_save' do
9
+ # expect(post: "/admin/frontend/views/#{@view.id}/live_editor/save").to route_to(
10
+ # controller: 'keppler_frontend/admin/views',
11
+ # action: 'live_editor_save',
12
+ # view_id: @view.id.to_s
13
+ # )
14
+ # end
15
15
 
16
16
  it 'routes GET /admin/frontend/views/new' do
17
17
  expect(get: "/admin/frontend/views/new").to route_to(
@@ -24,6 +24,14 @@ RSpec.describe 'routing to views', type: :routing do
24
24
  expect(post: "/admin/frontend/views").to route_to(
25
25
  controller: 'keppler_frontend/admin/views',
26
26
  action: 'create'
27
+ )
28
+ end
29
+
30
+ it 'routes GET /admin/frontend/views/:id/editor' do
31
+ expect(get: "/admin/frontend/views/#{@view.id}/editor").to route_to(
32
+ controller: 'keppler_frontend/admin/views',
33
+ action: 'editor',
34
+ view_id: @view.id.to_s
27
35
  )
28
36
  end
29
37
  end
@@ -0,0 +1,35 @@
1
+ require 'rails_helper'
2
+ require 'byebug'
3
+
4
+ RSpec.describe KepplerFrontend::Editor::FileFormat, type: :services do
5
+
6
+ context 'File Format' do
7
+ let(:root) { KepplerFrontend::Urls::Roots.new }
8
+ let(:fixture) { "#{root.keppler_root}/spec/fixtures/keppler_frontend/editor" }
9
+ let(:html) { "#{root.rocket_root}/app/assets/html/keppler_frontend/views" }
10
+
11
+ before(:each) do
12
+ FileUtils.mv("#{fixture}/test.png", "#{html}/test.png")
13
+ FileUtils.mv("#{fixture}/test.html", "#{html}/test.html")
14
+ @file_format = KepplerFrontend::Editor::FileFormat.new
15
+ @formats = ['.jpg', '.jpeg', '.png', '.svg', '.gif', '.tiff', '.bmp', '.mp3',
16
+ '.eot', '.otf', '.ttf', '.woff', '.woff2', '.mp4', '.mpeg', '.webm', '.m4v',
17
+ '.html', '.js', '.coffee', '.json', '.css', '.scss', 'sass'
18
+ ]
19
+ end
20
+
21
+ context 'validate file by format' do
22
+ it 'test formats' do
23
+ @formats.each do |f|
24
+ expect(@file_format.validate("test.#{f}")).to eq(true)
25
+ end
26
+ expect(@file_format.validate("test.xyz")).to eq(false)
27
+ end
28
+ end
29
+
30
+ after(:each) do
31
+ FileUtils.mv("#{html}/test.png", "#{fixture}/test.png")
32
+ FileUtils.mv("#{html}/test.html", "#{fixture}/test.html")
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,45 @@
1
+ require 'rails_helper'
2
+ require 'byebug'
3
+
4
+ RSpec.describe KepplerFrontend::Editor::ResourcesFormat, type: :services do
5
+
6
+ context 'Resources Format' do
7
+ let(:root) { KepplerFrontend::Urls::Roots.new }
8
+ let(:fixture) { "#{root.keppler_root}/spec/fixtures/keppler_frontend/editor" }
9
+ let(:images) { "#{root.rocket_root}/app/assets/images/keppler_frontend/app" }
10
+ let(:html) { "#{root.rocket_root}/app/assets/html/keppler_frontend/views" }
11
+
12
+ before(:each) do
13
+ @resources = KepplerFrontend::Editor::Resources.new
14
+ FileUtils.mv("#{fixture}/test.png", "#{images}/test.png")
15
+ FileUtils.mv("#{fixture}/test.html", "#{html}/test.html")
16
+ end
17
+
18
+ context 'output with app container' do
19
+ before(:each) do
20
+ @resources = KepplerFrontend::Editor::ResourcesFormat.new(@resources.list.last[:name], 'app')
21
+ end
22
+
23
+ it { expect(@resources.output).to be_a(Hash) }
24
+ it { expect(@resources.output.count).to eq(11) }
25
+ it { expect(@resources.output[:name]).to eq("test.png") }
26
+ it { expect(@resources.output[:format]).to eq("png") }
27
+ end
28
+
29
+ context 'output with view container' do
30
+ before(:each) do
31
+ @resources = KepplerFrontend::Editor::ResourcesFormat.new(@resources.custom_list('views').last[:name], 'views')
32
+ end
33
+
34
+ it { expect(@resources.output).to be_a(Hash) }
35
+ it { expect(@resources.output.count).to eq(11) }
36
+ it { expect(@resources.output[:name]).to eq("test.html") }
37
+ it { expect(@resources.output[:format]).to eq("html") }
38
+ end
39
+
40
+ after(:each) do
41
+ FileUtils.mv("#{images}/test.png", "#{fixture}/test.png")
42
+ FileUtils.mv("#{html}/test.html", "#{fixture}/test.html")
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,44 @@
1
+ require 'rails_helper'
2
+ require 'byebug'
3
+
4
+ RSpec.describe KepplerFrontend::Editor::Resources, type: :services do
5
+
6
+ context 'Resources' do
7
+ let(:root) { KepplerFrontend::Urls::Roots.new }
8
+ let(:fixture) { "#{root.keppler_root}/spec/fixtures/keppler_frontend/editor" }
9
+ let(:images) { "#{root.rocket_root}/app/assets/images/keppler_frontend/app" }
10
+ let(:html) { "#{root.rocket_root}/app/assets/html/keppler_frontend/views" }
11
+
12
+ before(:each) do
13
+ @resources = KepplerFrontend::Editor::Resources.new
14
+ FileUtils.mv("#{fixture}/test.png", "#{images}/test.png")
15
+ FileUtils.mv("#{fixture}/test.html", "#{html}/test.html")
16
+ end
17
+
18
+ context 'list' do
19
+ let(:content) { @resources.list.map { |r| r[:name] } }
20
+
21
+ it { expect(@resources.list).not_to eq(false) }
22
+ it { expect(@resources.list).not_to eq(nil) }
23
+ it { expect(@resources.list.count).not_to eq(0) }
24
+ it { expect(@resources.list.last[:name]).to eq("test.png") }
25
+ it { expect(@resources.list).to be_a(Array) }
26
+ it { expect(@resources.list.first).to be_a(Hash) }
27
+ end
28
+
29
+ context 'custom list' do
30
+ context 'views' do
31
+ it { expect(@resources.custom_list('views')).not_to eq(false) }
32
+ it { expect(@resources.custom_list('views')).to be_a(Array) }
33
+ it { expect(@resources.custom_list('views').first).to be_a(Hash) }
34
+ it { expect(@resources.custom_list('views').first[:format]).to eq('html') }
35
+ it { expect(@resources.custom_list('views').last[:name]).to eq("test.html") }
36
+ end
37
+ end
38
+
39
+ after(:each) do
40
+ FileUtils.mv("#{images}/test.png", "#{fixture}/test.png")
41
+ FileUtils.mv("#{html}/test.html", "#{fixture}/test.html")
42
+ end
43
+ end
44
+ end
@@ -6,15 +6,14 @@ RSpec.describe KepplerFrontend::Utils::CodeSearch, type: :services do
6
6
  context 'code search' do
7
7
 
8
8
  before(:all) do
9
- urls = KepplerFrontend::Urls::Assets.new
10
- core_app = urls.core_assets('html', 'app')
11
- component = Dir["#{core_app}/**/*.html"].first
9
+ urls = KepplerFrontend::Urls::Roots.new
10
+ component = Dir["#{urls.rocket_root}/app/views/layouts/keppler_frontend/app/layouts/application.html.erb"].first
12
11
  lines = File.readlines(component)
13
12
  @find = KepplerFrontend::Utils::CodeSearch.new(lines)
14
13
  end
15
14
 
16
15
  context 'find between a range of lines' do
17
- let(:find_section) { @find.search_section('<script>', '</script>') }
16
+ let(:find_section) { @find.search_section(' <keppler-header>', ' </keppler-header>') }
18
17
 
19
18
  it { expect(find_section).to be_a(Array) }
20
19
  it { expect(find_section.count).to eq(2) }
@@ -22,7 +21,7 @@ RSpec.describe KepplerFrontend::Utils::CodeSearch, type: :services do
22
21
  end
23
22
 
24
23
  context 'find a lines' do
25
- let(:find_section) { @find.search_line('<script>') }
24
+ let(:find_section) { @find.search_line(' <keppler-header>') }
26
25
 
27
26
  it { expect(find_section).to be_a(Numeric) }
28
27
  end
@@ -0,0 +1,52 @@
1
+ require 'rails_helper'
2
+ require 'byebug'
3
+
4
+ RSpec.describe KepplerFrontend::Utils::FileFormat, type: :services do
5
+
6
+ context 'File Format' do
7
+ let(:root) { KepplerFrontend::Urls::Roots.new }
8
+ let(:fixture) { "#{root.keppler_root}/spec/fixtures/keppler_frontend/editor" }
9
+ let(:html) { "#{root.rocket_root}/app/assets/html/keppler_frontend/views" }
10
+
11
+ before(:each) do
12
+ @file_format = KepplerFrontend::Utils::FileFormat.new
13
+ @folders = ['audios', 'fonts', 'images', 'videos', 'html', 'javascripts', 'stylesheets']
14
+ @formats = ['.jpg', '.jpeg', '.png', '.svg', '.gif', '.tiff', '.bmp', '.mp3',
15
+ '.eot', '.otf', '.ttf', '.woff', '.woff2', '.mp4', '.mpeg', '.webm', '.m4v',
16
+ '.html', '.js', '.coffee', '.json', '.css', '.scss', 'sass'
17
+ ]
18
+ end
19
+
20
+ context 'array of folders' do
21
+ it { expect(@file_format.folders).to be_a(Array) }
22
+ it { expect(@file_format.folders).to eq(@folders) }
23
+ end
24
+
25
+ context 'valid formats' do
26
+ it { expect(@file_format.formats).to be_a(Hash) }
27
+ it { expect(@file_format.formats.count).to eq(@folders.count) }
28
+ it { expect(@file_format.formats[:audios]).to eq(['.mp3']) }
29
+ it { expect(@file_format.formats[:fonts]).to eq(['.eot', '.otf', '.ttf', '.woff', '.woff2']) }
30
+ it { expect(@file_format.formats[:images]).to eq(['.jpg', '.jpeg', '.png', '.svg', '.gif', '.tiff', '.bmp']) }
31
+ it { expect(@file_format.formats[:videos]).to eq(['.mp4', '.mpeg', '.webm', '.m4v']) }
32
+ it { expect(@file_format.formats[:html]).to eq(['.html']) }
33
+ it { expect(@file_format.formats[:javascripts]).to eq(['.js', '.coffee', '.json']) }
34
+ it { expect(@file_format.formats[:stylesheets]).to eq(['.css', '.scss', '.sass']) }
35
+ end
36
+
37
+ context 'find folder by format file' do
38
+ it 'one by one' do
39
+ @formats.each do |f|
40
+ expect(@file_format.folder("test.#{f}")).to be_a(String)
41
+ expect(@file_format.folder("test.#{f}")).not_to eq('')
42
+ expect(@folders).to include(@file_format.folder("test.#{f}"))
43
+ end
44
+ end
45
+ end
46
+
47
+ context 'get file size format' do
48
+ it { expect(@file_format.size(1028)).to be_a(String) }
49
+ it { expect(@file_format.size(1028)).to eq("1.0 Kb") }
50
+ end
51
+ end
52
+ end
@@ -3,35 +3,38 @@ require 'byebug'
3
3
 
4
4
  RSpec.describe KepplerFrontend::Utils::YmlHandler, type: :services do
5
5
 
6
+ before(:all) do
7
+ @config = KepplerFrontend::Urls::Config.new
8
+ @yml_original = File.read(@config.yml('views'))
9
+ end
10
+
6
11
  before(:each) do
12
+ @config = KepplerFrontend::Urls::Config.new
7
13
  @view = create(:keppler_frontend_views, method: "GET")
8
14
  @views = KepplerFrontend::View.all
9
15
  @yml = KepplerFrontend::Utils::YmlHandler.new('views', @views)
10
- @config = KepplerFrontend::Urls::Config.new
11
16
  end
12
17
 
13
18
  context 'update' do
14
- before(:each) { @update_yml = @yml.update }
19
+ let(:update_yml) { @yml.update }
15
20
  let(:database) { KepplerFrontend::View.all.map { |v| v.name } }
16
- let(:yml) { YAML.load_file(File.join(@config.yml('views'))).map { |v| v["name"] } }
21
+ let(:yml) { YAML.load_file(@config.yml('views')).map { |v| v['name'] } }
17
22
 
18
- it { expect(@update_yml).to eq(true) }
23
+ it { expect(update_yml).to eq(true) }
19
24
  it { expect(yml).to eq(database) }
20
25
  end
21
26
 
22
27
  context 'reload' do
23
- before(:each) { @reload_yml = @yml.reload }
28
+ let(:reload_yml) { @yml.reload }
24
29
  let(:database) { KepplerFrontend::View.all.map { |v| v.name } }
25
- let(:yml) { YAML.load_file(File.join(@config.yml('views'))).map { |v| v["name"] } }
30
+ let(:yml) { YAML.load_file(@config.yml('views')).map { |v| v['name'] } }
26
31
 
27
- it { expect(@reload_yml).to eq(true) }
32
+ it { expect(reload_yml).to eq(true) }
28
33
  it { expect(yml).to eq(database) }
29
34
  end
30
35
 
31
- after(:each) do
32
- @view.destroy
33
- @views = KepplerFrontend::View.all
34
- @yml = KepplerFrontend::Utils::YmlHandler.new(@views)
35
- @yml.update
36
+ after(:all) do
37
+ File.write(@config.yml('views'), @yml_original)
36
38
  end
39
+
37
40
  end
@@ -45,6 +45,8 @@ RSpec.configure do |config|
45
45
  # triggering implicit auto-inclusion in groups with matching metadata.
46
46
  config.shared_context_metadata_behavior = :apply_to_host_groups
47
47
 
48
+
49
+
48
50
  # The settings below are suggested to provide a good initial experience
49
51
  # with RSpec, but feel free to customize to your heart's content.
50
52
  =begin
@@ -10,5 +10,5 @@ haml-lint app/views/admin
10
10
  echo '##################### Test Ruby ##########################################'
11
11
  bundle exec rubocop
12
12
  echo '##################### RSpec ##############################################'
13
- # bundle exec rspec
13
+ bundle exec rspec
14
14
  echo '##################### Ready ##############################################'