coverage/index.html in trusty-cms-2.0.26 vs coverage/index.html in trusty-cms-2.0.27

- old
+ new

@@ -1,42 +1,42 @@ <!DOCTYPE html> <html xmlns='http://www.w3.org/1999/xhtml'> <head> <title>Code coverage for Trusty-cms</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> - <script src='./assets/0.10.0/application.js' type='text/javascript'></script> - <link href='./assets/0.10.0/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'> - <link rel="shortcut icon" type="image/png" href="./assets/0.10.0/favicon_yellow.png" /> - <link rel="icon" type="image/png" href="./assets/0.10.0/favicon.png" /> + <script src='./assets/0.10.1/application.js' type='text/javascript'></script> + <link href='./assets/0.10.1/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'> + <link rel="shortcut icon" type="image/png" href="./assets/0.10.1/favicon_yellow.png" /> + <link rel="icon" type="image/png" href="./assets/0.10.1/favicon.png" /> </head> <body> <div id="loading"> - <img src="./assets/0.10.0/loading.gif" alt="loading"/> + <img src="./assets/0.10.1/loading.gif" alt="loading"/> </div> <div id="wrapper" style="display:none;"> - <div class="timestamp">Generated <abbr class="timeago" title="2016-11-18T15:23:07-05:00">2016-11-18T15:23:07-05:00</abbr></div> + <div class="timestamp">Generated <abbr class="timeago" title="2017-06-29T15:23:32-04:00">2017-06-29T15:23:32-04:00</abbr></div> <ul class="group_tabs"></ul> <div id="content"> <div class="file_list_container" id="AllFiles"> <h2> <span class="group_name">All Files</span> - (<span class="covered_percent"><span class="yellow">84.15%</span></span> + (<span class="covered_percent"><span class="yellow">82.75%</span></span> covered at <span class="covered_strength"> <span class="green"> - 15.77 + 14.47 </span> </span> hits/line) </h2> <a name="AllFiles"></a> <div> - <b>54</b> files in total. - <b>1426</b> relevant lines. - <span class="green"><b>1200</b> lines covered</span> and - <span class="red"><b>226</b> lines missed </span> + <b>51</b> files in total. + <b>1368</b> relevant lines. + <span class="green"><b>1132</b> lines covered</span> and + <span class="red"><b>236</b> lines missed </span> </div> <table class="file_list"> <thead> <tr> <th>File</th> @@ -49,547 +49,517 @@ </tr> </thead> <tbody> <tr> - <td class="strong"><a href="#f599caf63215e126813bbd891071cc4dd1d3b8db" class="src_link" title="app/controllers/admin/configuration_controller.rb">app/controllers/admin/configuration_controller.rb</a></td> + <td class="strong"><a href="#62cf759e434708fbeb746a55de33bb36b1e37ec4" class="src_link" title="app/controllers/admin/configuration_controller.rb">app/controllers/admin/configuration_controller.rb</a></td> <td class="red strong">79.17 %</td> <td>50</td> <td>24</td> <td>19</td> <td>5</td> <td>2.1</td> </tr> <tr> - <td class="strong"><a href="#17657aadafa48e20fcb3bd8e5e210965c961320a" class="src_link" title="app/controllers/admin/extensions_controller.rb">app/controllers/admin/extensions_controller.rb</a></td> + <td class="strong"><a href="#a6725cae8a2e936c945c1e25371c3c620d3a657c" class="src_link" title="app/controllers/admin/extensions_controller.rb">app/controllers/admin/extensions_controller.rb</a></td> <td class="red strong">60.0 %</td> <td>11</td> <td>5</td> <td>3</td> <td>2</td> <td>0.6</td> </tr> <tr> - <td class="strong"><a href="#21519a85f829e2fbd7235984e406553be64b6b27" class="src_link" title="app/controllers/admin/layouts_controller.rb">app/controllers/admin/layouts_controller.rb</a></td> + <td class="strong"><a href="#447268e306645459f370c88887f91d234443c15f" class="src_link" title="app/controllers/admin/layouts_controller.rb">app/controllers/admin/layouts_controller.rb</a></td> <td class="green strong">100.0 %</td> <td>8</td> <td>3</td> <td>3</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#325babca4b7e56052d91c8b2915714d266a831a1" class="src_link" title="app/controllers/admin/page_parts_controller.rb">app/controllers/admin/page_parts_controller.rb</a></td> - <td class="green strong">100.0 %</td> - <td>9</td> - <td>6</td> - <td>6</td> - <td>0</td> - <td>1.0</td> - </tr> - - <tr> - <td class="strong"><a href="#12b0c87d1b29324b336517e5a0d2d4df2cc9de32" class="src_link" title="app/controllers/admin/pages_controller.rb">app/controllers/admin/pages_controller.rb</a></td> - <td class="red strong">70.83 %</td> + <td class="strong"><a href="#eef04f79443b3c1cf5f1a94e49da169bb9bf9edf" class="src_link" title="app/controllers/admin/pages_controller.rb">app/controllers/admin/pages_controller.rb</a></td> + <td class="red strong">51.39 %</td> <td>114</td> <td>72</td> - <td>51</td> - <td>21</td> - <td>7.4</td> + <td>37</td> + <td>35</td> + <td>5.1</td> </tr> <tr> - <td class="strong"><a href="#327c19329660164ad68bedbd54229068fb659364" class="src_link" title="app/controllers/admin/preferences_controller.rb">app/controllers/admin/preferences_controller.rb</a></td> - <td class="yellow strong">82.35 %</td> - <td>29</td> - <td>17</td> - <td>14</td> + <td class="strong"><a href="#ffc0ea6768b2d6709d4896039faa4e70ac4ac143" class="src_link" title="app/controllers/admin/preferences_controller.rb">app/controllers/admin/preferences_controller.rb</a></td> + <td class="yellow strong">84.21 %</td> + <td>33</td> + <td>19</td> + <td>16</td> <td>3</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#977407fe9a2d9fadbb1030a030adcae347c6b0e4" class="src_link" title="app/controllers/admin/resource_controller.rb">app/controllers/admin/resource_controller.rb</a></td> - <td class="yellow strong">85.83 %</td> - <td>244</td> - <td>120</td> - <td>103</td> + <td class="strong"><a href="#f692fbf97e936f3bd45af3c90782168361ccc8cc" class="src_link" title="app/controllers/admin/resource_controller.rb">app/controllers/admin/resource_controller.rb</a></td> + <td class="yellow strong">86.82 %</td> + <td>253</td> + <td>129</td> + <td>112</td> <td>17</td> - <td>6.7</td> + <td>5.4</td> </tr> <tr> - <td class="strong"><a href="#12f7b293396af1e7bb429783083e0914ad715492" class="src_link" title="app/controllers/admin/users_controller.rb">app/controllers/admin/users_controller.rb</a></td> + <td class="strong"><a href="#47ac572e0b34d388482c846744ee3f074340adf6" class="src_link" title="app/controllers/admin/users_controller.rb">app/controllers/admin/users_controller.rb</a></td> <td class="red strong">45.45 %</td> <td>40</td> <td>22</td> <td>10</td> <td>12</td> <td>0.5</td> </tr> <tr> - <td class="strong"><a href="#0548274635e28f0ade382b1fa914b469704b942f" class="src_link" title="app/controllers/admin/welcome_controller.rb">app/controllers/admin/welcome_controller.rb</a></td> + <td class="strong"><a href="#5c6640d980190f3dedb08432aaee8a53437ed042" class="src_link" title="app/controllers/admin/welcome_controller.rb">app/controllers/admin/welcome_controller.rb</a></td> <td class="green strong">93.33 %</td> <td>48</td> <td>30</td> <td>28</td> <td>2</td> - <td>10.7</td> + <td>10.2</td> </tr> <tr> - <td class="strong"><a href="#24df5092852a2bbf884d9a6bfe4815b19056ea68" class="src_link" title="app/controllers/application_controller.rb">app/controllers/application_controller.rb</a></td> - <td class="yellow strong">82.69 %</td> + <td class="strong"><a href="#6e3b2ace708c0ac95ee9137a230e5edbd7b679cf" class="src_link" title="app/controllers/application_controller.rb">app/controllers/application_controller.rb</a></td> + <td class="yellow strong">81.13 %</td> <td>99</td> - <td>52</td> + <td>53</td> <td>43</td> - <td>9</td> - <td>37.6</td> + <td>10</td> + <td>33.0</td> </tr> <tr> - <td class="strong"><a href="#41a9856bd8ee68d9d8cbdb50d567363cd4411956" class="src_link" title="app/controllers/site_controller.rb">app/controllers/site_controller.rb</a></td> - <td class="red strong">53.33 %</td> + <td class="strong"><a href="#74f1b1eb56997c2466627c97014c6f3d671f7c39" class="src_link" title="app/controllers/site_controller.rb">app/controllers/site_controller.rb</a></td> + <td class="red strong">47.37 %</td> <td>104</td> - <td>60</td> - <td>32</td> - <td>28</td> - <td>3.6</td> + <td>57</td> + <td>27</td> + <td>30</td> + <td>3.3</td> </tr> <tr> - <td class="strong"><a href="#9b973efca458788c05c2f1159ddf02033a2951e2" class="src_link" title="app/helpers/admin/configuration_helper.rb">app/helpers/admin/configuration_helper.rb</a></td> - <td class="green strong">90.48 %</td> + <td class="strong"><a href="#cc03ad26247a3bdcc329e31ea73e08a283b8ea36" class="src_link" title="app/helpers/admin/configuration_helper.rb">app/helpers/admin/configuration_helper.rb</a></td> + <td class="green strong">90.7 %</td> <td>81</td> - <td>42</td> - <td>38</td> + <td>43</td> + <td>39</td> <td>4</td> - <td>20.1</td> + <td>19.9</td> </tr> <tr> - <td class="strong"><a href="#a60b971bc58b9cda32471f0b9507a73bde5812c2" class="src_link" title="app/helpers/admin/extensions_helper.rb">app/helpers/admin/extensions_helper.rb</a></td> + <td class="strong"><a href="#0583e14b5869b1886c89eb809e50916c364b01a6" class="src_link" title="app/helpers/admin/extensions_helper.rb">app/helpers/admin/extensions_helper.rb</a></td> <td class="green strong">100.0 %</td> <td>2</td> <td>1</td> <td>1</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#f1b71910ed03a14a4fc4cce2c151914e870c1588" class="src_link" title="app/helpers/admin/layouts_helper.rb">app/helpers/admin/layouts_helper.rb</a></td> + <td class="strong"><a href="#780799138341b2bd1b7a771cb7ea1e4b8d371059" class="src_link" title="app/helpers/admin/layouts_helper.rb">app/helpers/admin/layouts_helper.rb</a></td> <td class="green strong">100.0 %</td> <td>3</td> <td>1</td> <td>1</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#352ca55a4f63d046b73dfeec822cb6b55487185d" class="src_link" title="app/helpers/admin/node_helper.rb">app/helpers/admin/node_helper.rb</a></td> + <td class="strong"><a href="#d40cbb4484c395b33e0e9bfafbbc256f5cb12015" class="src_link" title="app/helpers/admin/node_helper.rb">app/helpers/admin/node_helper.rb</a></td> <td class="red strong">67.39 %</td> <td>90</td> <td>46</td> <td>31</td> <td>15</td> - <td>2.2</td> + <td>1.8</td> </tr> <tr> - <td class="strong"><a href="#07cdad2482cd19a92b6c1e2ed1c9d59c7b7b0a2a" class="src_link" title="app/helpers/admin/pages_helper.rb">app/helpers/admin/pages_helper.rb</a></td> + <td class="strong"><a href="#e7c59205a85110bb8c0b557be26848074903cea6" class="src_link" title="app/helpers/admin/pages_helper.rb">app/helpers/admin/pages_helper.rb</a></td> <td class="red strong">78.57 %</td> <td>25</td> <td>14</td> <td>11</td> <td>3</td> - <td>3.4</td> + <td>2.3</td> </tr> <tr> - <td class="strong"><a href="#781d9751547430b5f53e45c0a93bbe1399c262fa" class="src_link" title="app/helpers/admin/preferences_helper.rb">app/helpers/admin/preferences_helper.rb</a></td> + <td class="strong"><a href="#0ee035f009c07e58e4e3d9a6704cb4ba16a813be" class="src_link" title="app/helpers/admin/preferences_helper.rb">app/helpers/admin/preferences_helper.rb</a></td> <td class="green strong">100.0 %</td> <td>3</td> <td>1</td> <td>1</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#f67b3ce4ba5dfcbf735dc48d7e441eb59a706783" class="src_link" title="app/helpers/admin/references_helper.rb">app/helpers/admin/references_helper.rb</a></td> + <td class="strong"><a href="#b9f79e9f0a5e53786231d79ecc59147566161e96" class="src_link" title="app/helpers/admin/references_helper.rb">app/helpers/admin/references_helper.rb</a></td> <td class="red strong">31.82 %</td> <td>46</td> <td>22</td> <td>7</td> <td>15</td> <td>0.3</td> </tr> <tr> - <td class="strong"><a href="#024a60096d1599d436568bc78004ef69dd2dbf20" class="src_link" title="app/helpers/admin/regions_helper.rb">app/helpers/admin/regions_helper.rb</a></td> + <td class="strong"><a href="#638a8fcd83a757c84c47eb75a0ac4b614cfc312e" class="src_link" title="app/helpers/admin/regions_helper.rb">app/helpers/admin/regions_helper.rb</a></td> <td class="green strong">94.74 %</td> <td>29</td> <td>19</td> <td>18</td> <td>1</td> - <td>164.8</td> + <td>137.9</td> </tr> <tr> - <td class="strong"><a href="#c36f97396afab7acde2fbe5a063b597d0b40f848" class="src_link" title="app/helpers/admin/resource_helper.rb">app/helpers/admin/resource_helper.rb</a></td> + <td class="strong"><a href="#cf38cad557129a7ce4c509abb1381d5e5a8ab33f" class="src_link" title="app/helpers/admin/resource_helper.rb">app/helpers/admin/resource_helper.rb</a></td> <td class="green strong">100.0 %</td> <td>2</td> <td>1</td> <td>1</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#b5b66cc2c9ceed019da04d236c18a819343756d7" class="src_link" title="app/helpers/admin/users_helper.rb">app/helpers/admin/users_helper.rb</a></td> + <td class="strong"><a href="#9c8cace70efe8f81b11255fbd8e7b3f365ea2cd5" class="src_link" title="app/helpers/admin/users_helper.rb">app/helpers/admin/users_helper.rb</a></td> <td class="red strong">33.33 %</td> <td>8</td> <td>6</td> <td>2</td> <td>4</td> <td>0.3</td> </tr> <tr> - <td class="strong"><a href="#84bf416885112758ab122c8fd5353d9486d18756" class="src_link" title="app/helpers/admin/welcome_helper.rb">app/helpers/admin/welcome_helper.rb</a></td> + <td class="strong"><a href="#3649edf8d6821131cad6b320472fa64882d39f89" class="src_link" title="app/helpers/admin/welcome_helper.rb">app/helpers/admin/welcome_helper.rb</a></td> <td class="green strong">100.0 %</td> <td>2</td> <td>1</td> <td>1</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#e8ceba241b247e5465fc091266d42235281b188b" class="src_link" title="app/helpers/application_helper.rb">app/helpers/application_helper.rb</a></td> - <td class="yellow strong">85.84 %</td> + <td class="strong"><a href="#364f910ecfbecc20b9050379b03e1addc3b0d788" class="src_link" title="app/helpers/application_helper.rb">app/helpers/application_helper.rb</a></td> + <td class="yellow strong">85.96 %</td> <td>213</td> - <td>113</td> - <td>97</td> + <td>114</td> + <td>98</td> <td>16</td> - <td>41.1</td> + <td>36.7</td> </tr> <tr> - <td class="strong"><a href="#a39d78c4fc93191de03915ecd09328b64f41b587" class="src_link" title="app/helpers/site_helper.rb">app/helpers/site_helper.rb</a></td> + <td class="strong"><a href="#7c4dfe079d96b6107e43f2787bd3eb7193bb8bd3" class="src_link" title="app/helpers/site_helper.rb">app/helpers/site_helper.rb</a></td> <td class="green strong">100.0 %</td> <td>2</td> <td>1</td> <td>1</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#24a478dc81cb312b20b3b6ff5d59f560307249ae" class="src_link" title="app/models/layout.rb">app/models/layout.rb</a></td> + <td class="strong"><a href="#ce84beeca2a57c15d5da143808d6f6e6eb85e430" class="src_link" title="app/models/layout.rb">app/models/layout.rb</a></td> <td class="green strong">100.0 %</td> - <td>16</td> - <td>9</td> - <td>9</td> + <td>15</td> + <td>8</td> + <td>8</td> <td>0</td> - <td>4.0</td> + <td>4.1</td> </tr> <tr> - <td class="strong"><a href="#0a4dd54b5173ef00862c0de3249f9062548ae0ed" class="src_link" title="app/models/menu_renderer.rb">app/models/menu_renderer.rb</a></td> + <td class="strong"><a href="#ff27dea68c6c1d7ca8aec7a74bb28dbc78c3517b" class="src_link" title="app/models/menu_renderer.rb">app/models/menu_renderer.rb</a></td> <td class="yellow strong">89.33 %</td> <td>140</td> <td>75</td> <td>67</td> <td>8</td> - <td>4.4</td> + <td>3.4</td> </tr> <tr> - <td class="strong"><a href="#802c290d3237e413d582c6e3df59d0b1a783c364" class="src_link" title="app/models/page_context.rb">app/models/page_context.rb</a></td> - <td class="red strong">62.07 %</td> - <td>47</td> - <td>29</td> - <td>18</td> - <td>11</td> - <td>6.3</td> - </tr> - - <tr> - <td class="strong"><a href="#ee99abb95d276df654be743872e18cebe9cd7a76" class="src_link" title="app/models/page_field.rb">app/models/page_field.rb</a></td> + <td class="strong"><a href="#49c0d6cdd80063237788139caa212ff3b99f0569" class="src_link" title="app/models/page_field.rb">app/models/page_field.rb</a></td> <td class="green strong">100.0 %</td> - <td>4</td> <td>3</td> - <td>3</td> + <td>2</td> + <td>2</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#a305f6d4632c6314af7cf73ec29de843155d1b7c" class="src_link" title="app/models/page_part.rb">app/models/page_part.rb</a></td> - <td class="yellow strong">90.0 %</td> - <td>20</td> - <td>10</td> + <td class="strong"><a href="#bd093ce629db1b261871cea3d4882c14d0edc165" class="src_link" title="app/models/page_part.rb">app/models/page_part.rb</a></td> + <td class="yellow strong">88.89 %</td> + <td>19</td> <td>9</td> + <td>8</td> <td>1</td> - <td>4.5</td> + <td>2.7</td> </tr> <tr> - <td class="strong"><a href="#7388d43ba91c2a28d73545a6809e9d998ff37d21" class="src_link" title="app/models/status.rb">app/models/status.rb</a></td> + <td class="strong"><a href="#7bbb7a658abedc8bd08027742a2caa6df93f5d28" class="src_link" title="app/models/status.rb">app/models/status.rb</a></td> <td class="green strong">100.0 %</td> <td>41</td> <td>18</td> <td>18</td> <td>0</td> - <td>15.5</td> + <td>11.6</td> </tr> <tr> - <td class="strong"><a href="#a3d0e95dccc6cc402608c949f61537589888f7d7" class="src_link" title="app/models/text_filter.rb">app/models/text_filter.rb</a></td> - <td class="red strong">68.75 %</td> + <td class="strong"><a href="#f75912d7024ea4b17e23b6212deece9f8d099be8" class="src_link" title="app/models/text_filter.rb">app/models/text_filter.rb</a></td> + <td class="red strong">62.5 %</td> <td>31</td> <td>16</td> - <td>11</td> - <td>5</td> - <td>0.7</td> + <td>10</td> + <td>6</td> + <td>0.6</td> </tr> <tr> - <td class="strong"><a href="#3245bdc6bf68c4799ba1a1df23d11fe7c154286c" class="src_link" title="app/models/user.rb">app/models/user.rb</a></td> - <td class="yellow strong">82.69 %</td> - <td>97</td> - <td>52</td> - <td>43</td> + <td class="strong"><a href="#81a323fefe55031208374870d21243beae4e4565" class="src_link" title="app/models/user.rb">app/models/user.rb</a></td> + <td class="yellow strong">82.35 %</td> + <td>96</td> + <td>51</td> + <td>42</td> <td>9</td> - <td>5.6</td> + <td>5.3</td> </tr> <tr> - <td class="strong"><a href="#224090690cd46a1b82b33b9876817d1d65b88e42" class="src_link" title="app/models/user_action_observer.rb">app/models/user_action_observer.rb</a></td> + <td class="strong"><a href="#8e9451d3350618c4464083f2173ec92c1cbba22a" class="src_link" title="app/models/user_action_observer.rb">app/models/user_action_observer.rb</a></td> <td class="green strong">100.0 %</td> <td>25</td> <td>14</td> <td>14</td> <td>0</td> - <td>24.1</td> + <td>21.6</td> </tr> <tr> - <td class="strong"><a href="#d68b3b291e170af9809ca2750a36de47a6d1f510" class="src_link" title="lib/login_system.rb">lib/login_system.rb</a></td> + <td class="strong"><a href="#6b2b4e11dc5e71e9e79d239984b30738d065981e" class="src_link" title="lib/login_system.rb">lib/login_system.rb</a></td> <td class="red strong">78.95 %</td> <td>131</td> <td>76</td> <td>60</td> <td>16</td> - <td>55.8</td> + <td>50.8</td> </tr> <tr> - <td class="strong"><a href="#bfaefba265a613847eb17511c91aeb33124d3b07" class="src_link" title="lib/trusty_cms/admin_ui/region_partials.rb">lib/trusty_cms/admin_ui/region_partials.rb</a></td> + <td class="strong"><a href="#11328cfb263cce0e77b424d30c11127e715be20e" class="src_link" title="lib/trusty_cms/admin_ui/region_partials.rb">lib/trusty_cms/admin_ui/region_partials.rb</a></td> <td class="yellow strong">83.33 %</td> <td>23</td> <td>12</td> <td>10</td> <td>2</td> - <td>125.1</td> + <td>104.1</td> </tr> <tr> - <td class="strong"><a href="#62bfb9f3ee6e8ac2730bec06c3df334c59428c84" class="src_link" title="lib/trusty_cms/available_locales.rb">lib/trusty_cms/available_locales.rb</a></td> + <td class="strong"><a href="#67d6fd9b574c8bb746cfbd6f1d3ec545d3671999" class="src_link" title="lib/trusty_cms/available_locales.rb">lib/trusty_cms/available_locales.rb</a></td> <td class="green strong">100.0 %</td> <td>19</td> <td>10</td> <td>10</td> <td>0</td> - <td>73.7</td> + <td>79.3</td> </tr> <tr> - <td class="strong"><a href="#7ec5b193ca91bf0e62afdd726aa3bd77aba3eaaa" class="src_link" title="lib/trusty_cms/pagination/controller.rb">lib/trusty_cms/pagination/controller.rb</a></td> + <td class="strong"><a href="#0fb2f38734135f195dc6f55c5f8f8c33b0473268" class="src_link" title="lib/trusty_cms/pagination/controller.rb">lib/trusty_cms/pagination/controller.rb</a></td> <td class="green strong">92.86 %</td> <td>41</td> <td>14</td> <td>13</td> <td>1</td> - <td>17.8</td> + <td>15.6</td> </tr> <tr> - <td class="strong"><a href="#bed13f447cc3293c2e33013bd302547d11b4f7be" class="src_link" title="lib/trusty_cms/resource_responses.rb">lib/trusty_cms/resource_responses.rb</a></td> + <td class="strong"><a href="#a2cfabfa5bf3002a51933c8f57119adc7d3d50d3" class="src_link" title="lib/trusty_cms/resource_responses.rb">lib/trusty_cms/resource_responses.rb</a></td> <td class="red strong">80.0 %</td> <td>121</td> <td>70</td> <td>56</td> <td>14</td> - <td>14.6</td> + <td>12.6</td> </tr> <tr> - <td class="strong"><a href="#caa7ec0029d51eb5c9bde0f679fcfcb448b3cd01" class="src_link" title="spec/controllers/application_controller_spec.rb">spec/controllers/application_controller_spec.rb</a></td> + <td class="strong"><a href="#ad28fc13353a228211160292c64c178f99d727f2" class="src_link" title="spec/controllers/application_controller_spec.rb">spec/controllers/application_controller_spec.rb</a></td> <td class="green strong">100.0 %</td> <td>60</td> <td>40</td> <td>40</td> <td>0</td> <td>1.5</td> </tr> <tr> - <td class="strong"><a href="#337cbe163bc8bfdb5179ca7658af10ab02e6c229" class="src_link" title="spec/controllers/users_controller_spec.rb">spec/controllers/users_controller_spec.rb</a></td> + <td class="strong"><a href="#ac954dc35f7a221e8e355b693dff48716a41c94f" class="src_link" title="spec/controllers/users_controller_spec.rb">spec/controllers/users_controller_spec.rb</a></td> <td class="green strong">100.0 %</td> <td>6</td> <td>3</td> <td>3</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#a27fd50274e4ef14baece85f6fc1ef2dff24481e" class="src_link" title="spec/controllers/welcome_controller_spec.rb">spec/controllers/welcome_controller_spec.rb</a></td> + <td class="strong"><a href="#3cc0a60749736c01618a4dac4a949ad19f971ebf" class="src_link" title="spec/controllers/welcome_controller_spec.rb">spec/controllers/welcome_controller_spec.rb</a></td> <td class="green strong">100.0 %</td> <td>6</td> <td>3</td> <td>3</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#b8f4cd120e1d67bc8beac165fcf0bc0aa4481001" class="src_link" title="spec/factories/layout.rb">spec/factories/layout.rb</a></td> + <td class="strong"><a href="#2e372ce9efba322966a99a44ae3037847b4b7262" class="src_link" title="spec/factories/layout.rb">spec/factories/layout.rb</a></td> <td class="green strong">100.0 %</td> <td>17</td> <td>4</td> <td>4</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#52c1bc36f76c25cd101e46c7a3f7a84525c34f4b" class="src_link" title="spec/factories/page.rb">spec/factories/page.rb</a></td> + <td class="strong"><a href="#13f9da5e4654a837d7a7fa4bf4dfe846817dcbe8" class="src_link" title="spec/factories/page.rb">spec/factories/page.rb</a></td> <td class="green strong">94.12 %</td> <td>63</td> <td>34</td> <td>32</td> <td>2</td> <td>0.9</td> </tr> <tr> - <td class="strong"><a href="#a6d1c85998b8276583505169d707d367cc646d80" class="src_link" title="spec/factories/page_part.rb">spec/factories/page_part.rb</a></td> + <td class="strong"><a href="#43c889995f5a88d85b177672c6b7258a36da847d" class="src_link" title="spec/factories/page_part.rb">spec/factories/page_part.rb</a></td> <td class="green strong">100.0 %</td> <td>8</td> <td>4</td> <td>4</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#859825ade596f74e620e85f509164a957b8443d5" class="src_link" title="spec/factories/user.rb">spec/factories/user.rb</a></td> + <td class="strong"><a href="#bb53b254f55492b65c9488519a4a084dbbbdcae2" class="src_link" title="spec/factories/user.rb">spec/factories/user.rb</a></td> <td class="green strong">100.0 %</td> <td>35</td> <td>25</td> <td>25</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#5d70a4be91101af4532a395a46c8d595d80b8fb0" class="src_link" title="spec/features/admin_login_spec.rb">spec/features/admin_login_spec.rb</a></td> + <td class="strong"><a href="#6b795fc960ee17e8313e6ee8aacb5edd5dc7a92b" class="src_link" title="spec/features/admin_login_spec.rb">spec/features/admin_login_spec.rb</a></td> <td class="green strong">100.0 %</td> <td>92</td> <td>52</td> <td>52</td> <td>0</td> <td>1.3</td> </tr> <tr> - <td class="strong"><a href="#a413cd7cc1724408d7a525553d4834265f04885e" class="src_link" title="spec/features/config_spec.rb">spec/features/config_spec.rb</a></td> + <td class="strong"><a href="#7add22ef7d3b00bd38c2c13423da3140645cd781" class="src_link" title="spec/features/config_spec.rb">spec/features/config_spec.rb</a></td> <td class="green strong">100.0 %</td> <td>34</td> <td>21</td> <td>21</td> <td>0</td> <td>1.3</td> </tr> <tr> - <td class="strong"><a href="#ab78dbd6e5a827bfa8db3f97d98882ca4edbba01" class="src_link" title="spec/features/javascript_smoke_spec.rb">spec/features/javascript_smoke_spec.rb</a></td> + <td class="strong"><a href="#c35ea2aae277770e5b88ca23c8d45289ba333a8a" class="src_link" title="spec/features/layouts_spec.rb">spec/features/layouts_spec.rb</a></td> <td class="green strong">100.0 %</td> - <td>59</td> - <td>30</td> - <td>30</td> - <td>0</td> - <td>1.0</td> - </tr> - - <tr> - <td class="strong"><a href="#7570781db4c3155e965463b658470da596800bab" class="src_link" title="spec/features/layouts_spec.rb">spec/features/layouts_spec.rb</a></td> - <td class="green strong">100.0 %</td> <td>49</td> <td>33</td> <td>33</td> <td>0</td> <td>1.3</td> </tr> <tr> - <td class="strong"><a href="#d4d1a930f2f47b0ce0846efa1c917ebdf0bf2c69" class="src_link" title="spec/features/pages_spec.rb">spec/features/pages_spec.rb</a></td> - <td class="green strong">100.0 %</td> + <td class="strong"><a href="#00a8a76a40cbc43916d2f53c3e4536194342e0d1" class="src_link" title="spec/features/pages_spec.rb">spec/features/pages_spec.rb</a></td> + <td class="green strong">94.12 %</td> <td>55</td> <td>34</td> - <td>34</td> - <td>0</td> - <td>1.2</td> + <td>32</td> + <td>2</td> + <td>1.1</td> </tr> <tr> - <td class="strong"><a href="#f651b1e0d6b03b639bb1910679349dcb5c4906d8" class="src_link" title="spec/models/layout_spec.rb">spec/models/layout_spec.rb</a></td> + <td class="strong"><a href="#26d35c1978083211ae85513115d98df410ca5244" class="src_link" title="spec/models/layout_spec.rb">spec/models/layout_spec.rb</a></td> <td class="green strong">100.0 %</td> <td>29</td> <td>19</td> <td>19</td> <td>0</td> <td>1.1</td> </tr> <tr> - <td class="strong"><a href="#5e6e398d1f9a901307ea91dab9ee535aa8c9a444" class="src_link" title="spec/rails_helper.rb">spec/rails_helper.rb</a></td> - <td class="green strong">100.0 %</td> + <td class="strong"><a href="#a251c7546c3386878c1808f13620f76a33137872" class="src_link" title="spec/rails_helper.rb">spec/rails_helper.rb</a></td> + <td class="green strong">95.83 %</td> <td>73</td> <td>24</td> - <td>24</td> - <td>0</td> - <td>3.1</td> + <td>23</td> + <td>1</td> + <td>3.5</td> </tr> <tr> - <td class="strong"><a href="#e26ef2de8407666da2a4b16334e43c210a4e8735" class="src_link" title="spec/routing/welcome_routing_spec.rb">spec/routing/welcome_routing_spec.rb</a></td> + <td class="strong"><a href="#2faf97185635284b364ffa6cdbc7f168db049fdb" class="src_link" title="spec/routing/welcome_routing_spec.rb">spec/routing/welcome_routing_spec.rb</a></td> <td class="green strong">100.0 %</td> <td>18</td> <td>8</td> <td>8</td> <td>0</td> <td>1.0</td> </tr> <tr> - <td class="strong"><a href="#992b2e5d02f76777327edeb5263d89e2cab32d72" class="src_link" title="spec/support/custom_actions.rb">spec/support/custom_actions.rb</a></td> + <td class="strong"><a href="#e8c568b143982375ae5eef071184d4fa41bfa61f" class="src_link" title="spec/support/custom_actions.rb">spec/support/custom_actions.rb</a></td> <td class="green strong">100.0 %</td> <td>10</td> <td>5</td> <td>5</td> <td>0</td> - <td>17.0</td> + <td>16.2</td> </tr> </tbody> </table> </div> @@ -597,18 +567,18 @@ </div> <div id="footer"> - Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.12.0 - and simplecov-html v0.10.0<br/> + Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.13.0 + and simplecov-html v0.10.1<br/> using RSpec </div> <div class="source_files"> - <div class="source_table" id="f599caf63215e126813bbd891071cc4dd1d3b8db"> + <div class="source_table" id="62cf759e434708fbeb746a55de33bb36b1e37ec4"> <div class="header"> <h3>app/controllers/admin/configuration_controller.rb</h3> <h4><span class="red">79.17 %</span> covered</h4> <div> <b>24</b> relevant lines. @@ -663,11 +633,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="8"> <span class="hits">1</span> - <code class="ruby"> before_filter :initialize_config</code> + <code class="ruby"> before_action :initialize_config</code> </li> <li class="never" data-hits="" data-linenumber="9"> @@ -921,12 +891,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="17657aadafa48e20fcb3bd8e5e210965c961320a"> + <div class="source_table" id="a6725cae8a2e936c945c1e25371c3c620d3a657c"> <div class="header"> <h3>app/controllers/admin/extensions_controller.rb</h3> <h4><span class="red">60.0 %</span> covered</h4> <div> <b>5</b> relevant lines. @@ -1005,12 +976,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="21519a85f829e2fbd7235984e406553be64b6b27"> + <div class="source_table" id="447268e306645459f370c88887f91d234443c15f"> <div class="header"> <h3>app/controllers/admin/layouts_controller.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>3</b> relevant lines. @@ -1071,91 +1043,20 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="325babca4b7e56052d91c8b2915714d266a831a1"> + <div class="source_table" id="eef04f79443b3c1cf5f1a94e49da169bb9bf9edf"> <div class="header"> - <h3>app/controllers/admin/page_parts_controller.rb</h3> - <h4><span class="green">100.0 %</span> covered</h4> - <div> - <b>6</b> relevant lines. - <span class="green"><b>6</b> lines covered</span> and - <span class="red"><b>0</b> lines missed.</span> - </div> - </div> - - <pre> - <ol> - - <li class="covered" data-hits="1" data-linenumber="1"> - <span class="hits">1</span> - - <code class="ruby">class Admin::PagePartsController &lt; Admin::ResourceController</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="2"> - <span class="hits">1</span> - - <code class="ruby"> def create</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="3"> - <span class="hits">1</span> - - <code class="ruby"> self.model.attributes = params[model_symbol]</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="4"> - <span class="hits">1</span> - - <code class="ruby"> @controller_name = &#39;page&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="5"> - <span class="hits">1</span> - - <code class="ruby"> @template_name = &#39;edit&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="6"> - <span class="hits">1</span> - - <code class="ruby"> render :partial =&gt; &quot;page_part&quot;, :object =&gt; model,</code> - </li> - - <li class="never" data-hits="" data-linenumber="7"> - - - <code class="ruby"> :locals =&gt; {:page_part_counter =&gt; params[:index].to_i}</code> - </li> - - <li class="never" data-hits="" data-linenumber="8"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="9"> - - - <code class="ruby">end</code> - </li> - - </ol> - </pre> -</div> - - <div class="source_table" id="12b0c87d1b29324b336517e5a0d2d4df2cc9de32"> - <div class="header"> <h3>app/controllers/admin/pages_controller.rb</h3> - <h4><span class="red">70.83 %</span> covered</h4> + <h4><span class="red">51.39 %</span> covered</h4> <div> <b>72</b> relevant lines. - <span class="green"><b>51</b> lines covered</span> and - <span class="red"><b>21</b> lines missed.</span> + <span class="green"><b>37</b> lines covered</span> and + <span class="red"><b>35</b> lines missed.</span> </div> </div> <pre> <ol> @@ -1167,17 +1068,17 @@ </li> <li class="covered" data-hits="1" data-linenumber="2"> <span class="hits">1</span> - <code class="ruby"> before_filter :initialize_meta_rows_and_buttons, :only =&gt; [:new, :edit, :create, :update]</code> + <code class="ruby"> before_action :initialize_meta_rows_and_buttons, :only =&gt; [:new, :edit, :create, :update]</code> </li> <li class="covered" data-hits="1" data-linenumber="3"> <span class="hits">1</span> - <code class="ruby"> before_filter :count_deleted_pages, :only =&gt; [:destroy]</code> + <code class="ruby"> before_action :count_deleted_pages, :only =&gt; [:destroy]</code> </li> <li class="covered" data-hits="1" data-linenumber="4"> <span class="hits">1</span> @@ -1302,18 +1203,18 @@ <span class="hits">1</span> <code class="ruby"> def index</code> </li> - <li class="covered" data-hits="25" data-linenumber="25"> - <span class="hits">25</span> + <li class="covered" data-hits="21" data-linenumber="25"> + <span class="hits">21</span> <code class="ruby"> @homepage = Page.find_by_parent_id(nil)</code> </li> - <li class="covered" data-hits="25" data-linenumber="26"> - <span class="hits">25</span> + <li class="covered" data-hits="21" data-linenumber="26"> + <span class="hits">21</span> <code class="ruby"> response_for :plural</code> </li> <li class="never" data-hits="" data-linenumber="27"> @@ -1332,24 +1233,24 @@ <span class="hits">1</span> <code class="ruby"> def new</code> </li> - <li class="covered" data-hits="4" data-linenumber="30"> - <span class="hits">4</span> + <li class="covered" data-hits="2" data-linenumber="30"> + <span class="hits">2</span> <code class="ruby"> @page = self.model = model_class.new_with_defaults(trusty_config)</code> </li> - <li class="covered" data-hits="4" data-linenumber="31"> - <span class="hits">4</span> + <li class="covered" data-hits="2" data-linenumber="31"> + <span class="hits">2</span> <code class="ruby"> assign_page_attributes</code> </li> - <li class="covered" data-hits="4" data-linenumber="32"> - <span class="hits">4</span> + <li class="covered" data-hits="2" data-linenumber="32"> + <span class="hits">2</span> <code class="ruby"> response_for :new</code> </li> <li class="never" data-hits="" data-linenumber="33"> @@ -1368,13 +1269,13 @@ <span class="hits">1</span> <code class="ruby"> def preview</code> </li> - <li class="covered" data-hits="1" data-linenumber="36"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="36"> + <code class="ruby"> render_preview</code> </li> <li class="never" data-hits="" data-linenumber="37"> @@ -1488,30 +1389,30 @@ <span class="hits">1</span> <code class="ruby"> def assign_page_attributes</code> </li> - <li class="covered" data-hits="4" data-linenumber="56"> - <span class="hits">4</span> + <li class="covered" data-hits="2" data-linenumber="56"> + <span class="hits">2</span> <code class="ruby"> if params[:page_id].blank?</code> </li> - <li class="covered" data-hits="3" data-linenumber="57"> - <span class="hits">3</span> + <li class="covered" data-hits="2" data-linenumber="57"> + <span class="hits">2</span> <code class="ruby"> self.model.slug = &#39;/&#39;</code> </li> <li class="never" data-hits="" data-linenumber="58"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="4" data-linenumber="59"> - <span class="hits">4</span> + <li class="covered" data-hits="2" data-linenumber="59"> + <span class="hits">2</span> <code class="ruby"> self.model.parent_id = params[:page_id]</code> </li> <li class="never" data-hits="" data-linenumber="60"> @@ -1530,42 +1431,42 @@ <span class="hits">1</span> <code class="ruby"> def model_class</code> </li> - <li class="covered" data-hits="198" data-linenumber="63"> - <span class="hits">198</span> + <li class="covered" data-hits="138" data-linenumber="63"> + <span class="hits">138</span> <code class="ruby"> if Page.descendants.any? { |d| d.to_s == params[:page_class] }</code> </li> <li class="missed" data-hits="0" data-linenumber="64"> <code class="ruby"> verify_page_class(params[:page_class])</code> </li> - <li class="covered" data-hits="99" data-linenumber="65"> - <span class="hits">99</span> + <li class="covered" data-hits="69" data-linenumber="65"> + <span class="hits">69</span> <code class="ruby"> elsif params[:page_id]</code> </li> - <li class="covered" data-hits="5" data-linenumber="66"> - <span class="hits">5</span> + <li class="missed" data-hits="0" data-linenumber="66"> + <code class="ruby"> Page.find(params[:page_id]).children</code> </li> <li class="never" data-hits="" data-linenumber="67"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="94" data-linenumber="68"> - <span class="hits">94</span> + <li class="covered" data-hits="69" data-linenumber="68"> + <span class="hits">69</span> <code class="ruby"> Page</code> </li> <li class="never" data-hits="" data-linenumber="69"> @@ -1590,25 +1491,25 @@ <span class="hits">1</span> <code class="ruby"> def render_preview</code> </li> - <li class="covered" data-hits="1" data-linenumber="73"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="73"> + <code class="ruby"> Page.transaction do</code> </li> - <li class="covered" data-hits="1" data-linenumber="74"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="74"> + <code class="ruby"> page_class = Page.descendants.include?(model_class) ? model_class : Page</code> </li> - <li class="covered" data-hits="1" data-linenumber="75"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="75"> + <code class="ruby"> if request.referer =~ %r{/admin/pages/(\d+)/edit}</code> </li> <li class="missed" data-hits="0" data-linenumber="76"> @@ -1632,43 +1533,43 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="1" data-linenumber="80"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="80"> + <code class="ruby"> page = page_class.new(params[:page])</code> </li> - <li class="covered" data-hits="1" data-linenumber="81"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="81"> + <code class="ruby"> page.published_at = page.updated_at = page.created_at = Time.now</code> </li> - <li class="covered" data-hits="1" data-linenumber="82"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="82"> + <code class="ruby"> page.parent = Page.find($1) if request.referer =~ %r{/admin/pages/(\d+)/children/new}</code> </li> <li class="never" data-hits="" data-linenumber="83"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="84"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="84"> + <code class="ruby"> page.pagination_parameters = pagination_parameters</code> </li> - <li class="covered" data-hits="1" data-linenumber="85"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="85"> + <code class="ruby"> process_with_exception(page)</code> </li> <li class="never" data-hits="" data-linenumber="86"> @@ -1692,31 +1593,31 @@ <span class="hits">1</span> <code class="ruby"> def process_with_exception(page)</code> </li> - <li class="covered" data-hits="1" data-linenumber="90"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="90"> + <code class="ruby"> page.process(request, response)</code> </li> - <li class="covered" data-hits="1" data-linenumber="91"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="91"> + <code class="ruby"> @performed_render = true</code> </li> - <li class="covered" data-hits="1" data-linenumber="92"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="92"> + <code class="ruby"> render template: &#39;site/show_page&#39;, layout: false</code> </li> - <li class="covered" data-hits="1" data-linenumber="93"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="93"> + <code class="ruby"> raise PreviewStop</code> </li> <li class="never" data-hits="" data-linenumber="94"> @@ -1758,30 +1659,30 @@ <span class="hits">1</span> <code class="ruby"> def initialize_meta_rows_and_buttons</code> </li> - <li class="covered" data-hits="7" data-linenumber="101"> - <span class="hits">7</span> + <li class="covered" data-hits="4" data-linenumber="101"> + <span class="hits">4</span> <code class="ruby"> @buttons_partials ||= []</code> </li> - <li class="covered" data-hits="7" data-linenumber="102"> - <span class="hits">7</span> + <li class="covered" data-hits="4" data-linenumber="102"> + <span class="hits">4</span> <code class="ruby"> @meta ||= []</code> </li> - <li class="covered" data-hits="7" data-linenumber="103"> - <span class="hits">7</span> + <li class="covered" data-hits="4" data-linenumber="103"> + <span class="hits">4</span> <code class="ruby"> @meta &lt;&lt; {:field =&gt; &quot;slug&quot;, :type =&gt; &quot;text_field&quot;, :args =&gt; [{:class =&gt; &#39;textbox&#39;, :maxlength =&gt; 100}]}</code> </li> - <li class="covered" data-hits="7" data-linenumber="104"> - <span class="hits">7</span> + <li class="covered" data-hits="4" data-linenumber="104"> + <span class="hits">4</span> <code class="ruby"> @meta &lt;&lt; {:field =&gt; &quot;breadcrumb&quot;, :type =&gt; &quot;text_field&quot;, :args =&gt; [{:class =&gt; &#39;textbox&#39;, :maxlength =&gt; 160}]}</code> </li> <li class="never" data-hits="" data-linenumber="105"> @@ -1845,18 +1746,19 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="327c19329660164ad68bedbd54229068fb659364"> + <div class="source_table" id="ffc0ea6768b2d6709d4896039faa4e70ac4ac143"> <div class="header"> <h3>app/controllers/admin/preferences_controller.rb</h3> - <h4><span class="yellow">82.35 %</span> covered</h4> + <h4><span class="yellow">84.21 %</span> covered</h4> <div> - <b>17</b> relevant lines. - <span class="green"><b>14</b> lines covered</span> and + <b>19</b> relevant lines. + <span class="green"><b>16</b> lines covered</span> and <span class="red"><b>3</b> lines missed.</span> </div> </div> <pre> @@ -1869,11 +1771,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="2"> <span class="hits">1</span> - <code class="ruby"> before_filter :initialize_variables</code> + <code class="ruby"> before_action :initialize_variables</code> </li> <li class="never" data-hits="" data-linenumber="3"> @@ -1941,11 +1843,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="14"> <span class="hits">1</span> - <code class="ruby"> if @user.update_attributes(params[:user])</code> + <code class="ruby"> if @user.update_attributes(preferences_params)</code> </li> <li class="covered" data-hits="1" data-linenumber="15"> <span class="hits">1</span> @@ -2031,24 +1933,49 @@ </li> <li class="never" data-hits="" data-linenumber="29"> + <code class="ruby"></code> + </li> + + <li class="covered" data-hits="1" data-linenumber="30"> + <span class="hits">1</span> + + <code class="ruby"> def preferences_params</code> + </li> + + <li class="covered" data-hits="1" data-linenumber="31"> + <span class="hits">1</span> + + <code class="ruby"> params.require(:user).permit(:name, :email, :login, :password, :password_confirmation, :locale)</code> + </li> + + <li class="never" data-hits="" data-linenumber="32"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="33"> + + <code class="ruby">end</code> </li> </ol> </pre> </div> + - <div class="source_table" id="977407fe9a2d9fadbb1030a030adcae347c6b0e4"> + <div class="source_table" id="f692fbf97e936f3bd45af3c90782168361ccc8cc"> <div class="header"> <h3>app/controllers/admin/resource_controller.rb</h3> - <h4><span class="yellow">85.83 %</span> covered</h4> + <h4><span class="yellow">86.82 %</span> covered</h4> <div> - <b>120</b> relevant lines. - <span class="green"><b>103</b> lines covered</span> and + <b>129</b> relevant lines. + <span class="green"><b>112</b> lines covered</span> and <span class="red"><b>17</b> lines missed.</span> </div> </div> <pre> @@ -2085,35 +2012,35 @@ </li> <li class="covered" data-hits="1" data-linenumber="6"> <span class="hits">1</span> - <code class="ruby"> before_filter :populate_format</code> + <code class="ruby"> before_action :populate_format</code> </li> <li class="covered" data-hits="1" data-linenumber="7"> <span class="hits">1</span> - <code class="ruby"> before_filter :never_cache</code> + <code class="ruby"> before_action :never_cache</code> </li> <li class="covered" data-hits="1" data-linenumber="8"> <span class="hits">1</span> - <code class="ruby"> before_filter :load_models, :only =&gt; :index</code> + <code class="ruby"> before_action :load_models, :only =&gt; :index</code> </li> <li class="covered" data-hits="1" data-linenumber="9"> <span class="hits">1</span> - <code class="ruby"> before_filter :load_model, :only =&gt; [:new, :create, :edit, :update, :remove, :destroy]</code> + <code class="ruby"> before_action :load_model, :only =&gt; [:new, :create, :edit, :update, :remove, :destroy]</code> </li> <li class="covered" data-hits="1" data-linenumber="10"> <span class="hits">1</span> - <code class="ruby"> after_filter :clear_model_cache, :only =&gt; [:create, :update, :destroy]</code> + <code class="ruby"> after_action :clear_model_cache, :only =&gt; [:create, :update, :destroy]</code> </li> <li class="never" data-hits="" data-linenumber="11"> @@ -2268,12 +2195,12 @@ <span class="hits">1</span> <code class="ruby"> r.create.publish(:xml, :json) { render format_symbol =&gt; model, :status =&gt; :created, :location =&gt; url_for(:format =&gt; format_symbol, :id =&gt; model) }</code> </li> - <li class="covered" data-hits="4" data-linenumber="37"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="37"> + <span class="hits">3</span> <code class="ruby"> r.create.default { redirect_to continue_url(params) }</code> </li> <li class="never" data-hits="" data-linenumber="38"> @@ -2304,12 +2231,12 @@ <span class="hits">1</span> <code class="ruby"> r.destroy.publish(:xml, :json) { head :deleted }</code> </li> - <li class="covered" data-hits="3" data-linenumber="43"> - <span class="hits">3</span> + <li class="covered" data-hits="2" data-linenumber="43"> + <span class="hits">2</span> <code class="ruby"> r.destroy.default { redirect_to continue_url(params) }</code> </li> <li class="never" data-hits="" data-linenumber="44"> @@ -2382,13 +2309,13 @@ <code class="ruby"> }, __FILE__, __LINE__</code> </li> - <li class="never" data-hits="" data-linenumber="56"> + <li class="covered" data-hits="1" data-linenumber="56"> + <span class="hits">1</span> - <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="57"> @@ -2415,11 +2342,11 @@ </li> <li class="never" data-hits="" data-linenumber="61"> - <code class="ruby"> model.update_attributes!(params[model_symbol]) # model.update_attributes!(params[model_symbol])</code> + <code class="ruby"> model.update_attributes!(permitted_params[model_symbol]) # model.update_attributes!(params[model_symbol])</code> </li> <li class="never" data-hits="" data-linenumber="62"> @@ -2436,13 +2363,13 @@ <code class="ruby"> }, __FILE__, __LINE__</code> </li> - <li class="never" data-hits="" data-linenumber="65"> + <li class="covered" data-hits="1" data-linenumber="65"> + <span class="hits">1</span> - <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="66"> @@ -2460,12 +2387,12 @@ <span class="hits">2</span> <code class="ruby"> model.destroy</code> </li> - <li class="covered" data-hits="2" data-linenumber="69"> - <span class="hits">2</span> + <li class="covered" data-hits="1" data-linenumber="69"> + <span class="hits">1</span> <code class="ruby"> response_for :destroy</code> </li> <li class="never" data-hits="" data-linenumber="70"> @@ -2484,12 +2411,12 @@ <span class="hits">1</span> <code class="ruby"> def self.model_class(model_class = nil)</code> </li> - <li class="covered" data-hits="40" data-linenumber="73"> - <span class="hits">40</span> + <li class="covered" data-hits="35" data-linenumber="73"> + <span class="hits">35</span> <code class="ruby"> @model_class ||= (model_class || self.controller_name).to_s.singularize.camelize.constantize</code> </li> <li class="never" data-hits="" data-linenumber="74"> @@ -2658,12 +2585,12 @@ <span class="hits">1</span> <code class="ruby"> def paginated?</code> </li> - <li class="covered" data-hits="38" data-linenumber="102"> - <span class="hits">38</span> + <li class="covered" data-hits="32" data-linenumber="102"> + <span class="hits">32</span> <code class="ruby"> self.class.paginated == true &amp;&amp; params[:pp] != &#39;all&#39;</code> </li> <li class="never" data-hits="" data-linenumber="103"> @@ -2706,42 +2633,42 @@ <span class="hits">1</span> <code class="ruby"> def pagination_parameters</code> </li> - <li class="covered" data-hits="37" data-linenumber="110"> - <span class="hits">37</span> + <li class="covered" data-hits="31" data-linenumber="110"> + <span class="hits">31</span> <code class="ruby"> pp = params[:pp] || TrustyCms.config[&#39;admin.pagination.per_page&#39;]</code> </li> - <li class="covered" data-hits="37" data-linenumber="111"> - <span class="hits">37</span> + <li class="covered" data-hits="31" data-linenumber="111"> + <span class="hits">31</span> <code class="ruby"> pp = (self.class.default_per_page || 50) if pp.blank?</code> </li> <li class="never" data-hits="" data-linenumber="112"> <code class="ruby"> {</code> </li> - <li class="covered" data-hits="37" data-linenumber="113"> - <span class="hits">37</span> + <li class="covered" data-hits="31" data-linenumber="113"> + <span class="hits">31</span> <code class="ruby"> :page =&gt; (params[:p] || 1).to_i,</code> </li> <li class="never" data-hits="" data-linenumber="114"> <code class="ruby"> :per_page =&gt; pp.to_i</code> </li> - <li class="covered" data-hits="37" data-linenumber="115"> - <span class="hits">37</span> + <li class="covered" data-hits="31" data-linenumber="115"> + <span class="hits">31</span> <code class="ruby"> }</code> </li> <li class="never" data-hits="" data-linenumber="116"> @@ -2850,12 +2777,12 @@ <span class="hits">1</span> <code class="ruby"> def model_class</code> </li> - <li class="covered" data-hits="40" data-linenumber="134"> - <span class="hits">40</span> + <li class="covered" data-hits="35" data-linenumber="134"> + <span class="hits">35</span> <code class="ruby"> self.class.model_class</code> </li> <li class="never" data-hits="" data-linenumber="135"> @@ -2874,12 +2801,12 @@ <span class="hits">1</span> <code class="ruby"> def model</code> </li> - <li class="covered" data-hits="25" data-linenumber="138"> - <span class="hits">25</span> + <li class="covered" data-hits="15" data-linenumber="138"> + <span class="hits">15</span> <code class="ruby"> instance_variable_get(&quot;@#{model_symbol}&quot;) || load_model</code> </li> <li class="never" data-hits="" data-linenumber="139"> @@ -2898,12 +2825,12 @@ <span class="hits">1</span> <code class="ruby"> def model=(object)</code> </li> - <li class="covered" data-hits="19" data-linenumber="142"> - <span class="hits">19</span> + <li class="covered" data-hits="13" data-linenumber="142"> + <span class="hits">13</span> <code class="ruby"> instance_variable_set(&quot;@#{model_symbol}&quot;, object)</code> </li> <li class="never" data-hits="" data-linenumber="143"> @@ -2916,12 +2843,12 @@ <span class="hits">1</span> <code class="ruby"> def load_model</code> </li> - <li class="covered" data-hits="15" data-linenumber="145"> - <span class="hits">15</span> + <li class="covered" data-hits="11" data-linenumber="145"> + <span class="hits">11</span> <code class="ruby"> self.model = if params[:id]</code> </li> <li class="covered" data-hits="6" data-linenumber="146"> @@ -2934,12 +2861,12 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="9" data-linenumber="148"> - <span class="hits">9</span> + <li class="covered" data-hits="5" data-linenumber="148"> + <span class="hits">5</span> <code class="ruby"> model_class.new()</code> </li> <li class="never" data-hits="" data-linenumber="149"> @@ -2988,12 +2915,12 @@ <span class="hits">1</span> <code class="ruby"> def models=(objects)</code> </li> - <li class="covered" data-hits="33" data-linenumber="157"> - <span class="hits">33</span> + <li class="covered" data-hits="29" data-linenumber="157"> + <span class="hits">29</span> <code class="ruby"> instance_variable_set(&quot;@#{plural_model_symbol}&quot;, objects)</code> </li> <li class="never" data-hits="" data-linenumber="158"> @@ -3006,12 +2933,12 @@ <span class="hits">1</span> <code class="ruby"> def load_models</code> </li> - <li class="covered" data-hits="33" data-linenumber="160"> - <span class="hits">33</span> + <li class="covered" data-hits="29" data-linenumber="160"> + <span class="hits">29</span> <code class="ruby"> self.models = paginated? ? model_class.paginate(pagination_parameters) : model_class.all</code> </li> <li class="never" data-hits="" data-linenumber="161"> @@ -3030,12 +2957,12 @@ <span class="hits">1</span> <code class="ruby"> def model_name</code> </li> - <li class="covered" data-hits="81" data-linenumber="164"> - <span class="hits">81</span> + <li class="covered" data-hits="59" data-linenumber="164"> + <span class="hits">59</span> <code class="ruby"> model_class.name</code> </li> <li class="never" data-hits="" data-linenumber="165"> @@ -3078,12 +3005,12 @@ <span class="hits">1</span> <code class="ruby"> def model_symbol</code> </li> - <li class="covered" data-hits="48" data-linenumber="172"> - <span class="hits">48</span> + <li class="covered" data-hits="30" data-linenumber="172"> + <span class="hits">30</span> <code class="ruby"> model_name.underscore.intern</code> </li> <li class="never" data-hits="" data-linenumber="173"> @@ -3096,12 +3023,12 @@ <span class="hits">1</span> <code class="ruby"> def plural_model_symbol</code> </li> - <li class="covered" data-hits="33" data-linenumber="175"> - <span class="hits">33</span> + <li class="covered" data-hits="29" data-linenumber="175"> + <span class="hits">29</span> <code class="ruby"> model_name.pluralize.underscore.intern</code> </li> <li class="never" data-hits="" data-linenumber="176"> @@ -3150,12 +3077,12 @@ <span class="hits">1</span> <code class="ruby"> def continue_url(options)</code> </li> - <li class="covered" data-hits="5" data-linenumber="184"> - <span class="hits">5</span> + <li class="covered" data-hits="3" data-linenumber="184"> + <span class="hits">3</span> <code class="ruby"> options[:redirect_to] || (params[:continue] ? {:action =&gt; &#39;edit&#39;, :id =&gt; model.id} : index_page_for_model)</code> </li> <li class="never" data-hits="" data-linenumber="185"> @@ -3174,42 +3101,42 @@ <span class="hits">1</span> <code class="ruby"> def index_page_for_model</code> </li> - <li class="covered" data-hits="5" data-linenumber="188"> - <span class="hits">5</span> + <li class="covered" data-hits="3" data-linenumber="188"> + <span class="hits">3</span> <code class="ruby"> parts = {:action =&gt; &quot;index&quot;}</code> </li> - <li class="covered" data-hits="5" data-linenumber="189"> - <span class="hits">5</span> + <li class="covered" data-hits="3" data-linenumber="189"> + <span class="hits">3</span> <code class="ruby"> if paginated? &amp;&amp; model &amp;&amp; i = model_class.all.index(model)</code> </li> - <li class="covered" data-hits="3" data-linenumber="190"> - <span class="hits">3</span> + <li class="covered" data-hits="2" data-linenumber="190"> + <span class="hits">2</span> <code class="ruby"> p = (i / pagination_parameters[:per_page].to_i) + 1</code> </li> - <li class="covered" data-hits="3" data-linenumber="191"> - <span class="hits">3</span> + <li class="covered" data-hits="2" data-linenumber="191"> + <span class="hits">2</span> <code class="ruby"> parts[:p] = p if p &amp;&amp; p &gt; 1</code> </li> <li class="never" data-hits="" data-linenumber="192"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="5" data-linenumber="193"> - <span class="hits">5</span> + <li class="covered" data-hits="3" data-linenumber="193"> + <span class="hits">3</span> <code class="ruby"> parts</code> </li> <li class="never" data-hits="" data-linenumber="194"> @@ -3360,12 +3287,12 @@ <span class="hits">1</span> <code class="ruby"> def clear_model_cache</code> </li> - <li class="covered" data-hits="6" data-linenumber="219"> - <span class="hits">6</span> + <li class="covered" data-hits="3" data-linenumber="219"> + <span class="hits">3</span> <code class="ruby"> Rails.cache.clear</code> </li> <li class="never" data-hits="" data-linenumber="220"> @@ -3450,12 +3377,12 @@ <span class="hits">1</span> <code class="ruby"> def never_cache</code> </li> - <li class="covered" data-hits="49" data-linenumber="234"> - <span class="hits">49</span> + <li class="covered" data-hits="40" data-linenumber="234"> + <span class="hits">40</span> <code class="ruby"> expires_now</code> </li> <li class="never" data-hits="" data-linenumber="235"> @@ -3486,12 +3413,12 @@ <span class="hits">1</span> <code class="ruby"> def populate_format</code> </li> - <li class="covered" data-hits="49" data-linenumber="240"> - <span class="hits">49</span> + <li class="covered" data-hits="40" data-linenumber="240"> + <span class="hits">40</span> <code class="ruby"> params[:format] ||= &#39;html&#39; unless request.xhr?</code> </li> <li class="never" data-hits="" data-linenumber="241"> @@ -3504,27 +3431,82 @@ <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="243"> + <li class="covered" data-hits="1" data-linenumber="243"> + <span class="hits">1</span> + <code class="ruby"> def permitted_params</code> + </li> + + <li class="covered" data-hits="18" data-linenumber="244"> + <span class="hits">18</span> + <code class="ruby"> model_symbols = ActiveRecord::Base.descendants.map{|a| a.name.underscore.to_sym}</code> + </li> + + <li class="covered" data-hits="14" data-linenumber="245"> + <span class="hits">14</span> + + <code class="ruby"> keys = params.keys.map{|k| k.underscore.to_sym}</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="246"> + <span class="hits">2</span> + + <code class="ruby"> valid_symbols = model_symbols &amp; keys</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="247"> + <span class="hits">2</span> + + <code class="ruby"> valid_symbols.each do |symbol|</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="248"> + <span class="hits">2</span> + + <code class="ruby"> params[symbol].permit!</code> + </li> + + <li class="never" data-hits="" data-linenumber="249"> + + + <code class="ruby"> end</code> + </li> + + <li class="covered" data-hits="2" data-linenumber="250"> + <span class="hits">2</span> + + <code class="ruby"> params</code> + </li> + + <li class="never" data-hits="" data-linenumber="251"> + + + <code class="ruby"> end</code> + </li> + + <li class="never" data-hits="" data-linenumber="252"> + + <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="244"> + <li class="never" data-hits="" data-linenumber="253"> <code class="ruby">end</code> </li> </ol> </pre> </div> + - <div class="source_table" id="12f7b293396af1e7bb429783083e0914ad715492"> + <div class="source_table" id="47ac572e0b34d388482c846744ee3f074340adf6"> <div class="header"> <h3>app/controllers/admin/users_controller.rb</h3> <h4><span class="red">45.45 %</span> covered</h4> <div> <b>22</b> relevant lines. @@ -3579,11 +3561,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="8"> <span class="hits">1</span> - <code class="ruby"> before_filter :ensure_deletable, :only =&gt; [:remove, :destroy]</code> + <code class="ruby"> before_action :ensure_deletable, :only =&gt; [:remove, :destroy]</code> </li> <li class="never" data-hits="" data-linenumber="9"> @@ -3777,12 +3759,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="0548274635e28f0ade382b1fa914b469704b942f"> + <div class="source_table" id="5c6640d980190f3dedb08432aaee8a53437ed042"> <div class="header"> <h3>app/controllers/admin/welcome_controller.rb</h3> <h4><span class="green">93.33 %</span> covered</h4> <div> <b>30</b> relevant lines. @@ -3807,17 +3790,17 @@ </li> <li class="covered" data-hits="1" data-linenumber="3"> <span class="hits">1</span> - <code class="ruby"> before_filter :never_cache</code> + <code class="ruby"> before_action :never_cache</code> </li> <li class="covered" data-hits="1" data-linenumber="4"> <span class="hits">1</span> - <code class="ruby"> skip_before_filter :verify_authenticity_token</code> + <code class="ruby"> skip_before_action :verify_authenticity_token</code> </li> <li class="never" data-hits="" data-linenumber="5"> @@ -3828,12 +3811,12 @@ <span class="hits">1</span> <code class="ruby"> def index</code> </li> - <li class="covered" data-hits="23" data-linenumber="7"> - <span class="hits">23</span> + <li class="covered" data-hits="21" data-linenumber="7"> + <span class="hits">21</span> <code class="ruby"> redirect_to admin_pages_path</code> </li> <li class="never" data-hits="" data-linenumber="8"> @@ -3852,48 +3835,48 @@ <span class="hits">1</span> <code class="ruby"> def login</code> </li> - <li class="covered" data-hits="45" data-linenumber="11"> - <span class="hits">45</span> + <li class="covered" data-hits="43" data-linenumber="11"> + <span class="hits">43</span> <code class="ruby"> if request.post?</code> </li> - <li class="covered" data-hits="21" data-linenumber="12"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="12"> + <span class="hits">20</span> <code class="ruby"> @username_or_email = params[:username_or_email]</code> </li> - <li class="covered" data-hits="21" data-linenumber="13"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="13"> + <span class="hits">20</span> <code class="ruby"> password = params[:password]</code> </li> - <li class="covered" data-hits="21" data-linenumber="14"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="14"> + <span class="hits">20</span> <code class="ruby"> announce_invalid_user unless self.current_user = User.authenticate(@username_or_email, password)</code> </li> <li class="never" data-hits="" data-linenumber="15"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="45" data-linenumber="16"> - <span class="hits">45</span> + <li class="covered" data-hits="43" data-linenumber="16"> + <span class="hits">43</span> <code class="ruby"> if current_user</code> </li> - <li class="covered" data-hits="19" data-linenumber="17"> - <span class="hits">19</span> + <li class="covered" data-hits="18" data-linenumber="17"> + <span class="hits">18</span> <code class="ruby"> if params[:remember_me]</code> </li> <li class="missed" data-hits="0" data-linenumber="18"> @@ -3912,18 +3895,18 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="19" data-linenumber="21"> - <span class="hits">19</span> + <li class="covered" data-hits="18" data-linenumber="21"> + <span class="hits">18</span> <code class="ruby"> redirect_to(session[:return_to] || welcome_path)</code> </li> - <li class="covered" data-hits="19" data-linenumber="22"> - <span class="hits">19</span> + <li class="covered" data-hits="18" data-linenumber="22"> + <span class="hits">18</span> <code class="ruby"> session[:return_to] = nil</code> </li> <li class="never" data-hits="" data-linenumber="23"> @@ -4008,12 +3991,12 @@ <span class="hits">1</span> <code class="ruby"> def never_cache</code> </li> - <li class="covered" data-hits="69" data-linenumber="37"> - <span class="hits">69</span> + <li class="covered" data-hits="65" data-linenumber="37"> + <span class="hits">65</span> <code class="ruby"> expires_now</code> </li> <li class="never" data-hits="" data-linenumber="38"> @@ -4083,19 +4066,20 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="24df5092852a2bbf884d9a6bfe4815b19056ea68"> + <div class="source_table" id="6e3b2ace708c0ac95ee9137a230e5edbd7b679cf"> <div class="header"> <h3>app/controllers/application_controller.rb</h3> - <h4><span class="yellow">82.69 %</span> covered</h4> + <h4><span class="yellow">81.13 %</span> covered</h4> <div> - <b>52</b> relevant lines. + <b>53</b> relevant lines. <span class="green"><b>43</b> lines covered</span> and - <span class="red"><b>9</b> lines missed.</span> + <span class="red"><b>10</b> lines missed.</span> </div> </div> <pre> <ol> @@ -4161,47 +4145,47 @@ </li> <li class="covered" data-hits="1" data-linenumber="11"> <span class="hits">1</span> - <code class="ruby"> before_filter :set_current_user</code> + <code class="ruby"> before_action :set_current_user</code> </li> <li class="covered" data-hits="1" data-linenumber="12"> <span class="hits">1</span> - <code class="ruby"> before_filter :set_timezone</code> + <code class="ruby"> before_action :set_timezone</code> </li> <li class="covered" data-hits="1" data-linenumber="13"> <span class="hits">1</span> - <code class="ruby"> before_filter :set_user_locale</code> + <code class="ruby"> before_action :set_user_locale</code> </li> <li class="covered" data-hits="1" data-linenumber="14"> <span class="hits">1</span> - <code class="ruby"> before_filter :set_javascripts_and_stylesheets</code> + <code class="ruby"> before_action :set_javascripts_and_stylesheets</code> </li> <li class="covered" data-hits="1" data-linenumber="15"> <span class="hits">1</span> - <code class="ruby"> before_filter :force_utf8_params if RUBY_VERSION =~ /1\.9/</code> + <code class="ruby"> before_action :force_utf8_params if RUBY_VERSION =~ /1\.9/</code> </li> <li class="covered" data-hits="1" data-linenumber="16"> <span class="hits">1</span> - <code class="ruby"> before_filter :set_standard_body_style, :only =&gt; [:new, :edit, :update, :create]</code> + <code class="ruby"> before_action :set_standard_body_style, :only =&gt; [:new, :edit, :update, :create]</code> </li> <li class="covered" data-hits="1" data-linenumber="17"> <span class="hits">1</span> - <code class="ruby"> before_filter :set_mailer</code> + <code class="ruby"> before_action :set_mailer</code> </li> <li class="never" data-hits="" data-linenumber="18"> @@ -4236,18 +4220,18 @@ <span class="hits">1</span> <code class="ruby"> def initialize</code> </li> - <li class="covered" data-hits="361" data-linenumber="24"> - <span class="hits">361</span> + <li class="covered" data-hits="326" data-linenumber="24"> + <span class="hits">326</span> <code class="ruby"> super</code> </li> - <li class="covered" data-hits="361" data-linenumber="25"> - <span class="hits">361</span> + <li class="covered" data-hits="326" data-linenumber="25"> + <span class="hits">326</span> <code class="ruby"> @trusty_config = TrustyCms::Config</code> </li> <li class="never" data-hits="" data-linenumber="26"> @@ -4266,36 +4250,36 @@ <span class="hits">1</span> <code class="ruby"> def template_name</code> </li> - <li class="covered" data-hits="57" data-linenumber="29"> - <span class="hits">57</span> + <li class="covered" data-hits="51" data-linenumber="29"> + <span class="hits">51</span> <code class="ruby"> case self.action_name</code> </li> <li class="never" data-hits="" data-linenumber="30"> <code class="ruby"> when &#39;index&#39;</code> </li> - <li class="covered" data-hits="34" data-linenumber="31"> - <span class="hits">34</span> + <li class="covered" data-hits="30" data-linenumber="31"> + <span class="hits">30</span> <code class="ruby"> &#39;index&#39;</code> </li> <li class="never" data-hits="" data-linenumber="32"> <code class="ruby"> when &#39;new&#39;,&#39;create&#39;</code> </li> - <li class="covered" data-hits="7" data-linenumber="33"> - <span class="hits">7</span> + <li class="covered" data-hits="5" data-linenumber="33"> + <span class="hits">5</span> <code class="ruby"> &#39;new&#39;</code> </li> <li class="never" data-hits="" data-linenumber="34"> @@ -4380,12 +4364,12 @@ <span class="hits">1</span> <code class="ruby"> def set_mailer</code> </li> - <li class="covered" data-hits="151" data-linenumber="48"> - <span class="hits">151</span> + <li class="covered" data-hits="135" data-linenumber="48"> + <span class="hits">135</span> <code class="ruby"> ActionMailer::Base.default_url_options[:host] = request.host_with_port</code> </li> <li class="never" data-hits="" data-linenumber="49"> @@ -4404,12 +4388,12 @@ <span class="hits">1</span> <code class="ruby"> def set_current_user</code> </li> - <li class="covered" data-hits="151" data-linenumber="52"> - <span class="hits">151</span> + <li class="covered" data-hits="135" data-linenumber="52"> + <span class="hits">135</span> <code class="ruby"> UserActionObserver.instance.current_user = current_user</code> </li> <li class="never" data-hits="" data-linenumber="53"> @@ -4428,12 +4412,12 @@ <span class="hits">1</span> <code class="ruby"> def set_user_locale</code> </li> - <li class="covered" data-hits="151" data-linenumber="56"> - <span class="hits">151</span> + <li class="covered" data-hits="135" data-linenumber="56"> + <span class="hits">135</span> <code class="ruby"> I18n.locale = current_user &amp;&amp; !current_user.locale.blank? ? current_user.locale : TrustyCms::Config[&#39;default_locale&#39;]</code> </li> <li class="never" data-hits="" data-linenumber="57"> @@ -4452,12 +4436,12 @@ <span class="hits">1</span> <code class="ruby"> def set_timezone</code> </li> - <li class="covered" data-hits="153" data-linenumber="60"> - <span class="hits">153</span> + <li class="covered" data-hits="137" data-linenumber="60"> + <span class="hits">137</span> <code class="ruby"> Time.zone = TrustyCms::Config[&#39;local.timezone&#39;] != nil &amp;&amp; TrustyCms::Config[&#39;local.timezone&#39;].empty? ? Time.zone_default : TrustyCms::Config[&#39;local.timezone&#39;]</code> </li> <li class="never" data-hits="" data-linenumber="61"> @@ -4476,24 +4460,24 @@ <span class="hits">1</span> <code class="ruby"> def set_javascripts_and_stylesheets</code> </li> - <li class="covered" data-hits="152" data-linenumber="64"> - <span class="hits">152</span> + <li class="covered" data-hits="136" data-linenumber="64"> + <span class="hits">136</span> <code class="ruby"> @stylesheets ||= []</code> </li> - <li class="covered" data-hits="152" data-linenumber="65"> - <span class="hits">152</span> + <li class="covered" data-hits="136" data-linenumber="65"> + <span class="hits">136</span> <code class="ruby"> @stylesheets.concat %w(admin/main)</code> </li> - <li class="covered" data-hits="152" data-linenumber="66"> - <span class="hits">152</span> + <li class="covered" data-hits="136" data-linenumber="66"> + <span class="hits">136</span> <code class="ruby"> @javascripts ||= []</code> </li> <li class="never" data-hits="" data-linenumber="67"> @@ -4512,18 +4496,18 @@ <span class="hits">1</span> <code class="ruby"> def set_standard_body_style</code> </li> - <li class="covered" data-hits="15" data-linenumber="70"> - <span class="hits">15</span> + <li class="covered" data-hits="11" data-linenumber="70"> + <span class="hits">11</span> <code class="ruby"> @body_classes ||= []</code> </li> - <li class="covered" data-hits="15" data-linenumber="71"> - <span class="hits">15</span> + <li class="covered" data-hits="11" data-linenumber="71"> + <span class="hits">11</span> <code class="ruby"> @body_classes.concat(%w(reversed))</code> </li> <li class="never" data-hits="" data-linenumber="72"> @@ -4608,11 +4592,11 @@ <code class="ruby"> object.each_value { |o| traverse.call(o, block) }</code> </li> - <li class="never" data-hits="" data-linenumber="86"> + <li class="missed" data-hits="0" data-linenumber="86"> <code class="ruby"> elsif object.kind_of?(Array)</code> </li> @@ -4695,19 +4679,20 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="41a9856bd8ee68d9d8cbdb50d567363cd4411956"> + <div class="source_table" id="74f1b1eb56997c2466627c97014c6f3d671f7c39"> <div class="header"> <h3>app/controllers/site_controller.rb</h3> - <h4><span class="red">53.33 %</span> covered</h4> + <h4><span class="red">47.37 %</span> covered</h4> <div> - <b>60</b> relevant lines. - <span class="green"><b>32</b> lines covered</span> and - <span class="red"><b>28</b> lines missed.</span> + <b>57</b> relevant lines. + <span class="green"><b>27</b> lines covered</span> and + <span class="red"><b>30</b> lines missed.</span> </div> </div> <pre> <ol> @@ -4737,11 +4722,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="5"> <span class="hits">1</span> - <code class="ruby"> skip_filter :verify_authenticity_token</code> + <code class="ruby"> skip_before_action :verify_authenticity_token</code> </li> <li class="covered" data-hits="1" data-linenumber="6"> <span class="hits">1</span> @@ -4800,18 +4785,18 @@ <span class="hits">1</span> <code class="ruby"> def show_page</code> </li> - <li class="covered" data-hits="24" data-linenumber="16"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="16"> + <span class="hits">21</span> <code class="ruby"> url = params[:url]</code> </li> - <li class="covered" data-hits="24" data-linenumber="17"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="17"> + <span class="hits">21</span> <code class="ruby"> if Array === url</code> </li> <li class="missed" data-hits="0" data-linenumber="18"> @@ -4824,24 +4809,24 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="24" data-linenumber="20"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="20"> + <span class="hits">21</span> <code class="ruby"> url = url.to_s</code> </li> <li class="never" data-hits="" data-linenumber="21"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="24" data-linenumber="22"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="22"> + <span class="hits">21</span> <code class="ruby"> if @page = find_page(url)</code> </li> <li class="missed" data-hits="0" data-linenumber="23"> @@ -4908,13 +4893,13 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="1" data-linenumber="34"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="34"> + <code class="ruby"> render :template =&gt; &#39;site/not_found&#39;, :status =&gt; 404, layout: false</code> </li> <li class="never" data-hits="" data-linenumber="35"> @@ -4926,12 +4911,12 @@ <code class="ruby"> rescue Page::MissingRootPageError</code> </li> - <li class="covered" data-hits="23" data-linenumber="37"> - <span class="hits">23</span> + <li class="covered" data-hits="21" data-linenumber="37"> + <span class="hits">21</span> <code class="ruby"> redirect_to welcome_path</code> </li> <li class="never" data-hits="" data-linenumber="38"> @@ -4962,14 +4947,14 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="43"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="43"> - <code class="ruby"> hide_action :cacheable_request?</code> + + <code class="ruby"> # hide_action :cacheable_request?</code> </li> <li class="never" data-hits="" data-linenumber="44"> @@ -4992,14 +4977,14 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="48"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="48"> - <code class="ruby"> hide_action :set_expiry</code> + + <code class="ruby"> # hide_action :set_expiry</code> </li> <li class="never" data-hits="" data-linenumber="49"> @@ -5022,14 +5007,14 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="1" data-linenumber="53"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="53"> - <code class="ruby"> hide_action :set_expiry</code> + + <code class="ruby"> # hide_action :set_expiry</code> </li> <li class="never" data-hits="" data-linenumber="54"> @@ -5232,19 +5217,19 @@ <span class="hits">1</span> <code class="ruby"> def find_page(url)</code> </li> - <li class="covered" data-hits="24" data-linenumber="88"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="88"> + <span class="hits">21</span> <code class="ruby"> found = Page.find_by_path(url, live?)</code> </li> - <li class="covered" data-hits="1" data-linenumber="89"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="89"> + <code class="ruby"> found if found and (found.published? or dev?)</code> </li> <li class="never" data-hits="" data-linenumber="90"> @@ -5292,12 +5277,12 @@ <span class="hits">1</span> <code class="ruby"> def dev?</code> </li> - <li class="covered" data-hits="24" data-linenumber="98"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="98"> + <span class="hits">21</span> <code class="ruby"> request.host == @trusty_config[&#39;dev.host&#39;] || request.host =~ /^dev\./</code> </li> <li class="never" data-hits="" data-linenumber="99"> @@ -5316,12 +5301,12 @@ <span class="hits">1</span> <code class="ruby"> def live?</code> </li> - <li class="covered" data-hits="24" data-linenumber="102"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="102"> + <span class="hits">21</span> <code class="ruby"> not dev?</code> </li> <li class="never" data-hits="" data-linenumber="103"> @@ -5337,18 +5322,19 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="9b973efca458788c05c2f1159ddf02033a2951e2"> + <div class="source_table" id="cc03ad26247a3bdcc329e31ea73e08a283b8ea36"> <div class="header"> <h3>app/helpers/admin/configuration_helper.rb</h3> - <h4><span class="green">90.48 %</span> covered</h4> + <h4><span class="green">90.7 %</span> covered</h4> <div> - <b>42</b> relevant lines. - <span class="green"><b>38</b> lines covered</span> and + <b>43</b> relevant lines. + <span class="green"><b>39</b> lines covered</span> and <span class="red"><b>4</b> lines missed.</span> </div> </div> <pre> @@ -5487,11 +5473,11 @@ </li> <li class="covered" data-hits="50" data-linenumber="23"> <span class="hits">50</span> - <code class="ruby"> html &lt;&lt; content_tag(:span, &quot; #{t(&#39;warning&#39;)}: #{[setting.errors.get(:value)].flatten.first}&quot;, :class =&gt; &#39;warning&#39;) if setting.errors.get(:value)</code> + <code class="ruby"> html &lt;&lt; content_tag(:span, &quot; #{t(&#39;warning&#39;)}: #{[setting.errors[:value]].flatten.first}&quot;, :class =&gt; &#39;warning&#39;) if setting.errors.messages[:value].present?</code> </li> <li class="covered" data-hits="50" data-linenumber="24"> <span class="hits">50</span> @@ -5682,13 +5668,13 @@ <span class="hits">1</span> <code class="ruby"> html &lt;&lt; content_tag(:label, title.html_safe, :class =&gt; &#39;checkbox&#39;, :for =&gt; domkey)</code> </li> - <li class="never" data-hits="" data-linenumber="56"> + <li class="covered" data-hits="9" data-linenumber="56"> + <span class="hits">9</span> - <code class="ruby"> elsif setting.selector?</code> </li> <li class="covered" data-hits="4" data-linenumber="57"> <span class="hits">4</span> @@ -5841,12 +5827,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="a60b971bc58b9cda32471f0b9507a73bde5812c2"> + <div class="source_table" id="0583e14b5869b1886c89eb809e50916c364b01a6"> <div class="header"> <h3>app/helpers/admin/extensions_helper.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>1</b> relevant lines. @@ -5871,12 +5858,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="f1b71910ed03a14a4fc4cce2c151914e870c1588"> + <div class="source_table" id="780799138341b2bd1b7a771cb7ea1e4b8d371059"> <div class="header"> <h3>app/helpers/admin/layouts_helper.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>1</b> relevant lines. @@ -5907,12 +5895,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="352ca55a4f63d046b73dfeec822cb6b55487185d"> + <div class="source_table" id="d40cbb4484c395b33e0e9bfafbbc256f5cb12015"> <div class="header"> <h3>app/helpers/admin/node_helper.rb</h3> <h4><span class="red">67.39 %</span> covered</h4> <div> <b>46</b> relevant lines. @@ -5940,24 +5929,24 @@ <span class="hits">1</span> <code class="ruby"> def render_nodes(page, starting_index, parent_index = nil, simple = false)</code> </li> - <li class="covered" data-hits="5" data-linenumber="4"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="4"> + <span class="hits">4</span> <code class="ruby"> @rendered_html = &quot;&quot;</code> </li> - <li class="covered" data-hits="5" data-linenumber="5"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="5"> + <span class="hits">4</span> <code class="ruby"> render_node page, starting_index, parent_index, simple</code> </li> - <li class="covered" data-hits="5" data-linenumber="6"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="6"> + <span class="hits">4</span> <code class="ruby"> @rendered_html</code> </li> <li class="never" data-hits="" data-linenumber="7"> @@ -5982,42 +5971,42 @@ <code class="ruby"></code> </li> - <li class="covered" data-hits="5" data-linenumber="11"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="11"> + <span class="hits">4</span> <code class="ruby"> @current_node = prepare_page(page)</code> </li> <li class="never" data-hits="" data-linenumber="12"> <code class="ruby"></code> </li> - <li class="covered" data-hits="5" data-linenumber="13"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="13"> + <span class="hits">4</span> <code class="ruby"> @rendered_html += (render :partial =&gt; &#39;admin/pages/node&#39;,</code> </li> <li class="never" data-hits="" data-linenumber="14"> <code class="ruby"> :locals =&gt; {level: index, index: index, parent_index: parent_index,</code> </li> - <li class="covered" data-hits="5" data-linenumber="15"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="15"> + <span class="hits">4</span> <code class="ruby"> page: page, simple: simple, branch: (page.children.count &gt; 0) })</code> </li> - <li class="covered" data-hits="5" data-linenumber="16"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="16"> + <span class="hits">4</span> <code class="ruby"> index</code> </li> <li class="never" data-hits="" data-linenumber="17"> @@ -6036,24 +6025,24 @@ <span class="hits">1</span> <code class="ruby"> def prepare_page(page)</code> </li> - <li class="covered" data-hits="5" data-linenumber="20"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="20"> + <span class="hits">4</span> <code class="ruby"> page.extend MenuRenderer</code> </li> - <li class="covered" data-hits="5" data-linenumber="21"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="21"> + <span class="hits">4</span> <code class="ruby"> page.view = self</code> </li> - <li class="covered" data-hits="5" data-linenumber="22"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="22"> + <span class="hits">4</span> <code class="ruby"> if page.additional_menu_features?</code> </li> <li class="missed" data-hits="0" data-linenumber="23"> @@ -6066,12 +6055,12 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="5" data-linenumber="25"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="25"> + <span class="hits">4</span> <code class="ruby"> page</code> </li> <li class="never" data-hits="" data-linenumber="26"> @@ -6318,18 +6307,18 @@ <span class="hits">1</span> <code class="ruby"> def icon</code> </li> - <li class="covered" data-hits="5" data-linenumber="67"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="67"> + <span class="hits">4</span> <code class="ruby"> icon_name = @current_node.virtual? ? &#39;virtual_page&#39; : &#39;page&#39;</code> </li> - <li class="covered" data-hits="5" data-linenumber="68"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="68"> + <span class="hits">4</span> <code class="ruby"> image(icon_name, :class =&gt; &quot;icon&quot;, :alt =&gt; &#39;&#39;, :title =&gt; &#39;&#39;)</code> </li> <li class="never" data-hits="" data-linenumber="69"> @@ -6348,12 +6337,12 @@ <span class="hits">1</span> <code class="ruby"> def node_title</code> </li> - <li class="covered" data-hits="5" data-linenumber="72"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="72"> + <span class="hits">4</span> <code class="ruby"> %{&lt;span class=&quot;title&quot;&gt;#{ h(@current_node.title) }&lt;/span&gt;}.html_safe</code> </li> <li class="never" data-hits="" data-linenumber="73"> @@ -6372,24 +6361,24 @@ <span class="hits">1</span> <code class="ruby"> def page_type</code> </li> - <li class="covered" data-hits="4" data-linenumber="76"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="76"> + <span class="hits">3</span> <code class="ruby"> display_name = @current_node.class.display_name</code> </li> - <li class="covered" data-hits="4" data-linenumber="77"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="77"> + <span class="hits">3</span> <code class="ruby"> if display_name == &#39;Page&#39;</code> </li> - <li class="covered" data-hits="4" data-linenumber="78"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="78"> + <span class="hits">3</span> <code class="ruby"> &quot;&quot;</code> </li> <li class="never" data-hits="" data-linenumber="79"> @@ -6426,12 +6415,12 @@ <span class="hits">1</span> <code class="ruby"> def spinner</code> </li> - <li class="covered" data-hits="4" data-linenumber="85"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="85"> + <span class="hits">3</span> <code class="ruby"> image(&#39;spinner.gif&#39;,</code> </li> <li class="never" data-hits="" data-linenumber="86"> @@ -6465,12 +6454,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="07cdad2482cd19a92b6c1e2ed1c9d59c7b7b0a2a"> + <div class="source_table" id="e7c59205a85110bb8c0b557be26848074903cea6"> <div class="header"> <h3>app/helpers/admin/pages_helper.rb</h3> <h4><span class="red">78.57 %</span> covered</h4> <div> <b>14</b> relevant lines. @@ -6558,12 +6548,12 @@ <span class="hits">1</span> <code class="ruby"> def meta_errors?</code> </li> - <li class="covered" data-hits="10" data-linenumber="14"> - <span class="hits">10</span> + <li class="covered" data-hits="6" data-linenumber="14"> + <span class="hits">6</span> <code class="ruby"> !!(@page.errors[:slug] or @page.errors[:breadcrumb])</code> </li> <li class="never" data-hits="" data-linenumber="15"> @@ -6582,18 +6572,18 @@ <span class="hits">1</span> <code class="ruby"> def status_to_display</code> </li> - <li class="covered" data-hits="5" data-linenumber="18"> - <span class="hits">5</span> + <li class="covered" data-hits="3" data-linenumber="18"> + <span class="hits">3</span> <code class="ruby"> @page.status_id = 100 if @page.status_id == 90</code> </li> - <li class="covered" data-hits="25" data-linenumber="19"> - <span class="hits">25</span> + <li class="covered" data-hits="15" data-linenumber="19"> + <span class="hits">15</span> <code class="ruby"> @display_status = Status.selectable.map{ |s| [I18n.translate(s.name.downcase), s.id] }</code> </li> <li class="never" data-hits="" data-linenumber="20"> @@ -6633,12 +6623,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="781d9751547430b5f53e45c0a93bbe1399c262fa"> + <div class="source_table" id="0ee035f009c07e58e4e3d9a6704cb4ba16a813be"> <div class="header"> <h3>app/helpers/admin/preferences_helper.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>1</b> relevant lines. @@ -6669,12 +6660,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="f67b3ce4ba5dfcbf735dc48d7e441eb59a706783"> + <div class="source_table" id="b9f79e9f0a5e53786231d79ecc59147566161e96"> <div class="header"> <h3>app/helpers/admin/references_helper.rb</h3> <h4><span class="red">31.82 %</span> covered</h4> <div> <b>22</b> relevant lines. @@ -6963,12 +6955,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="024a60096d1599d436568bc78004ef69dd2dbf20"> + <div class="source_table" id="638a8fcd83a757c84c47eb75a0ac4b614cfc312e"> <div class="header"> <h3>app/helpers/admin/regions_helper.rb</h3> <h4><span class="green">94.74 %</span> covered</h4> <div> <b>19</b> relevant lines. @@ -6990,72 +6983,72 @@ <span class="hits">1</span> <code class="ruby"> def render_region(region, options={}, &amp;block)</code> </li> - <li class="covered" data-hits="287" data-linenumber="3"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="3"> + <span class="hits">239</span> <code class="ruby"> lazy_initialize_region_set</code> </li> - <li class="covered" data-hits="287" data-linenumber="4"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="4"> + <span class="hits">239</span> <code class="ruby"> default_partials = TrustyCms::AdminUI::RegionPartials.new(self)</code> </li> - <li class="covered" data-hits="287" data-linenumber="5"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="5"> + <span class="hits">239</span> <code class="ruby"> if block_given?</code> </li> - <li class="covered" data-hits="140" data-linenumber="6"> - <span class="hits">140</span> + <li class="covered" data-hits="121" data-linenumber="6"> + <span class="hits">121</span> <code class="ruby"> block.call(default_partials)</code> </li> - <li class="covered" data-hits="140" data-linenumber="7"> - <span class="hits">140</span> + <li class="covered" data-hits="121" data-linenumber="7"> + <span class="hits">121</span> <code class="ruby"> (options[:locals] ||= {}).merge!(:defaults =&gt; default_partials)</code> </li> <li class="never" data-hits="" data-linenumber="8"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="287" data-linenumber="9"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="9"> + <span class="hits">239</span> <code class="ruby"> output = @region_set[region].compact.map do |partial|</code> </li> - <li class="covered" data-hits="230" data-linenumber="10"> - <span class="hits">230</span> + <li class="covered" data-hits="191" data-linenumber="10"> + <span class="hits">191</span> <code class="ruby"> begin</code> </li> - <li class="covered" data-hits="230" data-linenumber="11"> - <span class="hits">230</span> + <li class="covered" data-hits="191" data-linenumber="11"> + <span class="hits">191</span> <code class="ruby"> render options.merge(:partial =&gt; partial)</code> </li> <li class="never" data-hits="" data-linenumber="12"> <code class="ruby"> rescue ::ActionView::MissingTemplate # couldn&#39;t find template</code> </li> - <li class="covered" data-hits="230" data-linenumber="13"> - <span class="hits">230</span> + <li class="covered" data-hits="191" data-linenumber="13"> + <span class="hits">191</span> <code class="ruby"> default_partials[partial]</code> </li> <li class="never" data-hits="" data-linenumber="14"> @@ -7080,18 +7073,18 @@ <code class="ruby"> end.join.html_safe</code> </li> - <li class="covered" data-hits="287" data-linenumber="18"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="18"> + <span class="hits">239</span> <code class="ruby"> Rails.logger.error(output)</code> </li> - <li class="covered" data-hits="287" data-linenumber="19"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="19"> + <span class="hits">239</span> <code class="ruby"> block_given? ? concat(output) : output</code> </li> <li class="never" data-hits="" data-linenumber="20"> @@ -7110,30 +7103,30 @@ <span class="hits">1</span> <code class="ruby"> def lazy_initialize_region_set</code> </li> - <li class="covered" data-hits="287" data-linenumber="23"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="23"> + <span class="hits">239</span> <code class="ruby"> unless @region_set</code> </li> - <li class="covered" data-hits="50" data-linenumber="24"> - <span class="hits">50</span> + <li class="covered" data-hits="43" data-linenumber="24"> + <span class="hits">43</span> <code class="ruby"> @controller_name ||= @_controller.controller_name</code> </li> - <li class="covered" data-hits="50" data-linenumber="25"> - <span class="hits">50</span> + <li class="covered" data-hits="43" data-linenumber="25"> + <span class="hits">43</span> <code class="ruby"> @template_name ||= @_controller.template_name</code> </li> - <li class="covered" data-hits="50" data-linenumber="26"> - <span class="hits">50</span> + <li class="covered" data-hits="43" data-linenumber="26"> + <span class="hits">43</span> <code class="ruby"> @region_set = admin.send(@controller_name).send(@template_name)</code> </li> <li class="never" data-hits="" data-linenumber="27"> @@ -7155,12 +7148,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="c36f97396afab7acde2fbe5a063b597d0b40f848"> + <div class="source_table" id="cf38cad557129a7ce4c509abb1381d5e5a8ab33f"> <div class="header"> <h3>app/helpers/admin/resource_helper.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>1</b> relevant lines. @@ -7185,12 +7179,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="b5b66cc2c9ceed019da04d236c18a819343756d7"> + <div class="source_table" id="9c8cace70efe8f81b11255fbd8e7b3f365ea2cd5"> <div class="header"> <h3>app/helpers/admin/users_helper.rb</h3> <h4><span class="red">33.33 %</span> covered</h4> <div> <b>6</b> relevant lines. @@ -7251,12 +7246,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="84bf416885112758ab122c8fd5353d9486d18756"> + <div class="source_table" id="3649edf8d6821131cad6b320472fa64882d39f89"> <div class="header"> <h3>app/helpers/admin/welcome_helper.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>1</b> relevant lines. @@ -7281,18 +7277,19 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="e8ceba241b247e5465fc091266d42235281b188b"> + <div class="source_table" id="364f910ecfbecc20b9050379b03e1addc3b0d788"> <div class="header"> <h3>app/helpers/application_helper.rb</h3> - <h4><span class="yellow">85.84 %</span> covered</h4> + <h4><span class="yellow">85.96 %</span> covered</h4> <div> - <b>113</b> relevant lines. - <span class="green"><b>97</b> lines covered</span> and + <b>114</b> relevant lines. + <span class="green"><b>98</b> lines covered</span> and <span class="red"><b>16</b> lines missed.</span> </div> </div> <pre> @@ -7320,12 +7317,12 @@ <span class="hits">1</span> <code class="ruby"> def trusty_config</code> </li> - <li class="covered" data-hits="150" data-linenumber="5"> - <span class="hits">150</span> + <li class="covered" data-hits="136" data-linenumber="5"> + <span class="hits">136</span> <code class="ruby"> TrustyCms::Config</code> </li> <li class="never" data-hits="" data-linenumber="6"> @@ -7344,12 +7341,12 @@ <span class="hits">1</span> <code class="ruby"> def default_page_title</code> </li> - <li class="covered" data-hits="75" data-linenumber="9"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="9"> + <span class="hits">68</span> <code class="ruby"> title + &#39; - &#39; + subtitle</code> </li> <li class="never" data-hits="" data-linenumber="10"> @@ -7368,12 +7365,12 @@ <span class="hits">1</span> <code class="ruby"> def title</code> </li> - <li class="covered" data-hits="75" data-linenumber="13"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="13"> + <span class="hits">68</span> <code class="ruby"> trusty_config[&#39;admin.title&#39;] || &#39;Trusty CMS&#39;</code> </li> <li class="never" data-hits="" data-linenumber="14"> @@ -7392,12 +7389,12 @@ <span class="hits">1</span> <code class="ruby"> def subtitle</code> </li> - <li class="covered" data-hits="75" data-linenumber="17"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="17"> + <span class="hits">68</span> <code class="ruby"> trusty_config[&#39;admin.subtitle&#39;] || &#39;Publishing for Small Teams&#39;</code> </li> <li class="never" data-hits="" data-linenumber="18"> @@ -7416,12 +7413,12 @@ <span class="hits">1</span> <code class="ruby"> def logged_in?</code> </li> - <li class="covered" data-hits="75" data-linenumber="21"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="21"> + <span class="hits">68</span> <code class="ruby"> !current_user.nil?</code> </li> <li class="never" data-hits="" data-linenumber="22"> @@ -7464,24 +7461,24 @@ <span class="hits">1</span> <code class="ruby"> def save_model_button(model, options = {})</code> </li> - <li class="covered" data-hits="8" data-linenumber="29"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="29"> + <span class="hits">6</span> <code class="ruby"> model_name = model.class.name.underscore</code> </li> - <li class="covered" data-hits="8" data-linenumber="30"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="30"> + <span class="hits">6</span> <code class="ruby"> human_model_name = model_name.humanize.titlecase</code> </li> - <li class="covered" data-hits="8" data-linenumber="31"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="31"> + <span class="hits">6</span> <code class="ruby"> options[:label] ||= model.new_record? ?</code> </li> <li class="never" data-hits="" data-linenumber="32"> @@ -7494,24 +7491,24 @@ <code class="ruby"> t(&#39;buttons.save_changes&#39;, :default =&gt; &#39;Save Changes&#39;)</code> </li> - <li class="covered" data-hits="8" data-linenumber="34"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="34"> + <span class="hits">6</span> <code class="ruby"> options[:class] ||= &quot;button&quot;</code> </li> - <li class="covered" data-hits="8" data-linenumber="35"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="35"> + <span class="hits">6</span> <code class="ruby"> options[:accesskey] ||= &#39;S&#39;</code> </li> - <li class="covered" data-hits="8" data-linenumber="36"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="36"> + <span class="hits">6</span> <code class="ruby"> submit_tag options.delete(:label), options</code> </li> <li class="never" data-hits="" data-linenumber="37"> @@ -7530,12 +7527,12 @@ <span class="hits">1</span> <code class="ruby"> def save_model_and_continue_editing_button(model)</code> </li> - <li class="covered" data-hits="7" data-linenumber="40"> - <span class="hits">7</span> + <li class="covered" data-hits="5" data-linenumber="40"> + <span class="hits">5</span> <code class="ruby"> submit_tag t(&#39;buttons.save_and_continue&#39;), :name =&gt; &#39;continue&#39;, :class =&gt; &#39;button&#39;, :accesskey =&gt; &quot;s&quot;</code> </li> <li class="never" data-hits="" data-linenumber="41"> @@ -7608,18 +7605,18 @@ <span class="hits">1</span> <code class="ruby"> def current_tab?(tab)</code> </li> - <li class="covered" data-hits="417" data-linenumber="53"> - <span class="hits">417</span> + <li class="covered" data-hits="363" data-linenumber="53"> + <span class="hits">363</span> <code class="ruby"> @current_tab ||= tab if tab.any? {|item| current_url?(item.relative_url) }</code> </li> - <li class="covered" data-hits="145" data-linenumber="54"> - <span class="hits">145</span> + <li class="covered" data-hits="127" data-linenumber="54"> + <span class="hits">127</span> <code class="ruby"> @current_tab == tab</code> </li> <li class="never" data-hits="" data-linenumber="55"> @@ -7638,12 +7635,12 @@ <span class="hits">1</span> <code class="ruby"> def current_url?(options)</code> </li> - <li class="covered" data-hits="412" data-linenumber="58"> - <span class="hits">412</span> + <li class="covered" data-hits="376" data-linenumber="58"> + <span class="hits">376</span> <code class="ruby"> url = case options</code> </li> <li class="never" data-hits="" data-linenumber="59"> @@ -7662,12 +7659,12 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="412" data-linenumber="62"> - <span class="hits">412</span> + <li class="covered" data-hits="376" data-linenumber="62"> + <span class="hits">376</span> <code class="ruby"> options.to_s</code> </li> <li class="never" data-hits="" data-linenumber="63"> @@ -7680,12 +7677,12 @@ <code class="ruby"> #TODO: look for other instances of request_uri</code> </li> - <li class="covered" data-hits="412" data-linenumber="65"> - <span class="hits">412</span> + <li class="covered" data-hits="376" data-linenumber="65"> + <span class="hits">376</span> <code class="ruby"> request.original_fullpath =~ Regexp.new(&#39;^&#39; + Regexp.quote(clean(url)))</code> </li> <li class="never" data-hits="" data-linenumber="66"> @@ -7704,18 +7701,18 @@ <span class="hits">1</span> <code class="ruby"> def clean(url)</code> </li> - <li class="covered" data-hits="412" data-linenumber="69"> - <span class="hits">412</span> + <li class="covered" data-hits="376" data-linenumber="69"> + <span class="hits">376</span> <code class="ruby"> uri = URI.parse(url)</code> </li> - <li class="covered" data-hits="412" data-linenumber="70"> - <span class="hits">412</span> + <li class="covered" data-hits="376" data-linenumber="70"> + <span class="hits">376</span> <code class="ruby"> uri.path.gsub(%r{/+}, &#39;/&#39;).gsub(%r{/$}, &#39;&#39;)</code> </li> <li class="never" data-hits="" data-linenumber="71"> @@ -7782,12 +7779,12 @@ <span class="hits">1</span> <code class="ruby"> def updated_stamp(model)</code> </li> - <li class="covered" data-hits="7" data-linenumber="82"> - <span class="hits">7</span> + <li class="covered" data-hits="5" data-linenumber="82"> + <span class="hits">5</span> <code class="ruby"> unless model.new_record?</code> </li> <li class="covered" data-hits="2" data-linenumber="83"> @@ -7926,12 +7923,12 @@ <span class="hits">1</span> <code class="ruby"> def meta_label</code> </li> - <li class="covered" data-hits="7" data-linenumber="106"> - <span class="hits">7</span> + <li class="covered" data-hits="5" data-linenumber="106"> + <span class="hits">5</span> <code class="ruby"> meta_errors? ? &#39;Less&#39; : &#39;More&#39;</code> </li> <li class="never" data-hits="" data-linenumber="107"> @@ -7950,12 +7947,12 @@ <span class="hits">1</span> <code class="ruby"> def image(name, options = {})</code> </li> - <li class="covered" data-hits="89" data-linenumber="110"> - <span class="hits">89</span> + <li class="covered" data-hits="66" data-linenumber="110"> + <span class="hits">66</span> <code class="ruby"> image_tag(append_image_extension(&quot;admin/#{name}&quot;), options)</code> </li> <li class="never" data-hits="" data-linenumber="111"> @@ -7974,12 +7971,12 @@ <span class="hits">1</span> <code class="ruby"> def admin</code> </li> - <li class="covered" data-hits="125" data-linenumber="114"> - <span class="hits">125</span> + <li class="covered" data-hits="109" data-linenumber="114"> + <span class="hits">109</span> <code class="ruby"> TrustyCms::AdminUI.instance</code> </li> <li class="never" data-hits="" data-linenumber="115"> @@ -7998,12 +7995,12 @@ <span class="hits">1</span> <code class="ruby"> def body_classes</code> </li> - <li class="covered" data-hits="108" data-linenumber="118"> - <span class="hits">108</span> + <li class="covered" data-hits="100" data-linenumber="118"> + <span class="hits">100</span> <code class="ruby"> @body_classes ||= []</code> </li> <li class="never" data-hits="" data-linenumber="119"> @@ -8022,12 +8019,12 @@ <span class="hits">1</span> <code class="ruby"> def nav_tabs</code> </li> - <li class="covered" data-hits="49" data-linenumber="122"> - <span class="hits">49</span> + <li class="covered" data-hits="43" data-linenumber="122"> + <span class="hits">43</span> <code class="ruby"> admin.nav</code> </li> <li class="never" data-hits="" data-linenumber="123"> @@ -8046,12 +8043,12 @@ <span class="hits">1</span> <code class="ruby"> def translate_with_default(name)</code> </li> - <li class="covered" data-hits="173" data-linenumber="126"> - <span class="hits">173</span> + <li class="covered" data-hits="155" data-linenumber="126"> + <span class="hits">155</span> <code class="ruby"> t(name.underscore.downcase, :default =&gt; name)</code> </li> <li class="never" data-hits="" data-linenumber="127"> @@ -8094,18 +8091,18 @@ <span class="hits">1</span> <code class="ruby"> def stylesheet_overrides</code> </li> - <li class="covered" data-hits="75" data-linenumber="134"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="134"> + <span class="hits">68</span> <code class="ruby"> overrides = []</code> </li> - <li class="covered" data-hits="75" data-linenumber="135"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="135"> + <span class="hits">68</span> <code class="ruby"> if File.exist?(&quot;#{Rails.root}/public/stylesheets/admin/overrides.css&quot;) || File.exist?(&quot;#{Rails.root}/public/stylesheets/sass/admin/overrides.sass&quot;)</code> </li> <li class="missed" data-hits="0" data-linenumber="136"> @@ -8118,12 +8115,12 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="75" data-linenumber="138"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="138"> + <span class="hits">68</span> <code class="ruby"> overrides</code> </li> <li class="never" data-hits="" data-linenumber="139"> @@ -8142,18 +8139,18 @@ <span class="hits">1</span> <code class="ruby"> def javascript_overrides</code> </li> - <li class="covered" data-hits="75" data-linenumber="142"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="142"> + <span class="hits">68</span> <code class="ruby"> overrides = []</code> </li> - <li class="covered" data-hits="75" data-linenumber="143"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="143"> + <span class="hits">68</span> <code class="ruby"> if File.exist?(&quot;#{Rails.root}/public/javascripts/admin/overrides.js&quot;)</code> </li> <li class="missed" data-hits="0" data-linenumber="144"> @@ -8166,12 +8163,12 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="75" data-linenumber="146"> - <span class="hits">75</span> + <li class="covered" data-hits="68" data-linenumber="146"> + <span class="hits">68</span> <code class="ruby"> overrides</code> </li> <li class="never" data-hits="" data-linenumber="147"> @@ -8466,13 +8463,13 @@ <code class="ruby"> html &lt;&lt; content_tag(:div, link_to(t(&#39;show_all&#39;), :pp =&gt; &#39;all&#39;), :class =&gt; &#39;depaginate&#39;)</code> </li> - <li class="never" data-hits="" data-linenumber="196"> + <li class="covered" data-hits="8" data-linenumber="196"> + <span class="hits">8</span> - <code class="ruby"> elsif depaginate &amp;&amp; list.total_entries &gt; depagination_limit.to_i</code> </li> <li class="missed" data-hits="0" data-linenumber="197"> @@ -8526,30 +8523,30 @@ <span class="hits">1</span> <code class="ruby"> def append_image_extension(name)</code> </li> - <li class="covered" data-hits="89" data-linenumber="206"> - <span class="hits">89</span> + <li class="covered" data-hits="66" data-linenumber="206"> + <span class="hits">66</span> <code class="ruby"> unless name =~ /\.(.*?)$/</code> </li> - <li class="covered" data-hits="75" data-linenumber="207"> - <span class="hits">75</span> + <li class="covered" data-hits="57" data-linenumber="207"> + <span class="hits">57</span> <code class="ruby"> name + &#39;.png&#39;</code> </li> <li class="never" data-hits="" data-linenumber="208"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="14" data-linenumber="209"> - <span class="hits">14</span> + <li class="covered" data-hits="9" data-linenumber="209"> + <span class="hits">9</span> <code class="ruby"> name</code> </li> <li class="never" data-hits="" data-linenumber="210"> @@ -8577,12 +8574,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="a39d78c4fc93191de03915ecd09328b64f41b587"> + <div class="source_table" id="7c4dfe079d96b6107e43f2787bd3eb7193bb8bd3"> <div class="header"> <h3>app/helpers/site_helper.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>1</b> relevant lines. @@ -8607,18 +8605,19 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="24a478dc81cb312b20b3b6ff5d59f560307249ae"> + <div class="source_table" id="ce84beeca2a57c15d5da143808d6f6e6eb85e430"> <div class="header"> <h3>app/models/layout.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>9</b> relevant lines. - <span class="green"><b>9</b> lines covered</span> and + <b>8</b> relevant lines. + <span class="green"><b>8</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -8628,105 +8627,100 @@ <span class="hits">1</span> <code class="ruby">class Layout &lt; ActiveRecord::Base</code> </li> - <li class="covered" data-hits="1" data-linenumber="2"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="2"> - <code class="ruby"> attr_protected :created_at, :updated_at</code> - </li> - - <li class="never" data-hits="" data-linenumber="3"> - <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="4"> + <li class="never" data-hits="" data-linenumber="3"> <code class="ruby"> # Default Order</code> </li> - <li class="covered" data-hits="28" data-linenumber="5"> - <span class="hits">28</span> + <li class="covered" data-hits="26" data-linenumber="4"> + <span class="hits">26</span> <code class="ruby"> default_scope {order(&quot;name&quot;)}</code> </li> - <li class="never" data-hits="" data-linenumber="6"> + <li class="never" data-hits="" data-linenumber="5"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="7"> + <li class="never" data-hits="" data-linenumber="6"> <code class="ruby"> # Associations</code> </li> - <li class="covered" data-hits="1" data-linenumber="8"> + <li class="covered" data-hits="1" data-linenumber="7"> <span class="hits">1</span> <code class="ruby"> has_many :pages</code> </li> - <li class="covered" data-hits="1" data-linenumber="9"> + <li class="covered" data-hits="1" data-linenumber="8"> <span class="hits">1</span> <code class="ruby"> belongs_to :created_by, :class_name =&gt; &#39;User&#39;</code> </li> - <li class="covered" data-hits="1" data-linenumber="10"> + <li class="covered" data-hits="1" data-linenumber="9"> <span class="hits">1</span> <code class="ruby"> belongs_to :updated_by, :class_name =&gt; &#39;User&#39;</code> </li> - <li class="never" data-hits="" data-linenumber="11"> + <li class="never" data-hits="" data-linenumber="10"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="12"> + <li class="never" data-hits="" data-linenumber="11"> <code class="ruby"> # Validations</code> </li> - <li class="covered" data-hits="1" data-linenumber="13"> + <li class="covered" data-hits="1" data-linenumber="12"> <span class="hits">1</span> <code class="ruby"> validates_presence_of :name</code> </li> - <li class="covered" data-hits="1" data-linenumber="14"> + <li class="covered" data-hits="1" data-linenumber="13"> <span class="hits">1</span> <code class="ruby"> validates_uniqueness_of :name</code> </li> - <li class="covered" data-hits="1" data-linenumber="15"> + <li class="covered" data-hits="1" data-linenumber="14"> <span class="hits">1</span> <code class="ruby"> validates_length_of :name, :maximum =&gt; 100</code> </li> - <li class="never" data-hits="" data-linenumber="16"> + <li class="never" data-hits="" data-linenumber="15"> <code class="ruby">end</code> </li> </ol> </pre> </div> + - <div class="source_table" id="0a4dd54b5173ef00862c0de3249f9062548ae0ed"> + <div class="source_table" id="ff27dea68c6c1d7ca8aec7a74bb28dbc78c3517b"> <div class="header"> <h3>app/models/menu_renderer.rb</h3> <h4><span class="yellow">89.33 %</span> covered</h4> <div> <b>75</b> relevant lines. @@ -8790,12 +8784,12 @@ <span class="hits">1</span> <code class="ruby"> def excluded_class_names</code> </li> - <li class="covered" data-hits="12" data-linenumber="10"> - <span class="hits">12</span> + <li class="covered" data-hits="9" data-linenumber="10"> + <span class="hits">9</span> <code class="ruby"> MenuRenderer.instance_variable_get(:@excluded_class_names)</code> </li> <li class="never" data-hits="" data-linenumber="11"> @@ -8832,12 +8826,12 @@ <span class="hits">1</span> <code class="ruby"> def view=(val)</code> </li> - <li class="covered" data-hits="5" data-linenumber="17"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="17"> + <span class="hits">4</span> <code class="ruby"> @view = val</code> </li> <li class="never" data-hits="" data-linenumber="18"> @@ -8856,12 +8850,12 @@ <span class="hits">1</span> <code class="ruby"> def view</code> </li> - <li class="covered" data-hits="52" data-linenumber="21"> - <span class="hits">52</span> + <li class="covered" data-hits="39" data-linenumber="21"> + <span class="hits">39</span> <code class="ruby"> @view</code> </li> <li class="never" data-hits="" data-linenumber="22"> @@ -8880,12 +8874,12 @@ <span class="hits">1</span> <code class="ruby"> def additional_menu_features?</code> </li> - <li class="covered" data-hits="5" data-linenumber="25"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="25"> + <span class="hits">4</span> <code class="ruby"> @additional_menu_features ||= (menu_renderer_module_name != &#39;MenuRenderer&#39; &amp;&amp; Object.const_defined?(menu_renderer_module_name))</code> </li> <li class="never" data-hits="" data-linenumber="26"> @@ -8904,18 +8898,18 @@ <span class="hits">1</span> <code class="ruby"> def menu_renderer_module_name</code> </li> - <li class="covered" data-hits="5" data-linenumber="29"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="29"> + <span class="hits">4</span> <code class="ruby"> simple_name = self.class_name.to_s.sub(&#39;Page&#39;,&#39;&#39;)</code> </li> - <li class="covered" data-hits="5" data-linenumber="30"> - <span class="hits">5</span> + <li class="covered" data-hits="4" data-linenumber="30"> + <span class="hits">4</span> <code class="ruby"> &quot;#{simple_name}MenuRenderer&quot;</code> </li> <li class="never" data-hits="" data-linenumber="31"> @@ -8958,24 +8952,24 @@ <span class="hits">1</span> <code class="ruby"> def allowed_child_classes</code> </li> - <li class="covered" data-hits="12" data-linenumber="38"> - <span class="hits">12</span> + <li class="covered" data-hits="9" data-linenumber="38"> + <span class="hits">9</span> <code class="ruby"> (allowed_children_cache.to_s.split(&#39;,&#39;) - Array(excluded_class_names)).map do |name|</code> </li> - <li class="covered" data-hits="24" data-linenumber="39"> - <span class="hits">24</span> + <li class="covered" data-hits="18" data-linenumber="39"> + <span class="hits">18</span> <code class="ruby"> begin</code> </li> - <li class="covered" data-hits="24" data-linenumber="40"> - <span class="hits">24</span> + <li class="covered" data-hits="18" data-linenumber="40"> + <span class="hits">18</span> <code class="ruby"> name.constantize</code> </li> <li class="never" data-hits="" data-linenumber="41"> @@ -8994,12 +8988,12 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="12" data-linenumber="44"> - <span class="hits">12</span> + <li class="covered" data-hits="9" data-linenumber="44"> + <span class="hits">9</span> <code class="ruby"> end.compact</code> </li> <li class="never" data-hits="" data-linenumber="45"> @@ -9024,12 +9018,12 @@ <span class="hits">1</span> <code class="ruby"> def default_child_item</code> </li> - <li class="covered" data-hits="4" data-linenumber="49"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="49"> + <span class="hits">3</span> <code class="ruby"> menu_item(default_child)</code> </li> <li class="never" data-hits="" data-linenumber="50"> @@ -9048,12 +9042,12 @@ <span class="hits">1</span> <code class="ruby"> def separator_item</code> </li> - <li class="covered" data-hits="4" data-linenumber="53"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="53"> + <span class="hits">3</span> <code class="ruby"> view.content_tag :li, &#39;&#39;, :class =&gt; &#39;separator&#39;</code> </li> <li class="never" data-hits="" data-linenumber="54"> @@ -9072,18 +9066,18 @@ <span class="hits">1</span> <code class="ruby"> def child_items</code> </li> - <li class="covered" data-hits="4" data-linenumber="57"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="57"> + <span class="hits">3</span> <code class="ruby"> (allowed_child_classes - [self.class.default_child]).map do |child|</code> </li> - <li class="covered" data-hits="4" data-linenumber="58"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="58"> + <span class="hits">3</span> <code class="ruby"> menu_item(child)</code> </li> <li class="never" data-hits="" data-linenumber="59"> @@ -9108,12 +9102,12 @@ <span class="hits">1</span> <code class="ruby"> def menu_items</code> </li> - <li class="covered" data-hits="4" data-linenumber="63"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="63"> + <span class="hits">3</span> <code class="ruby"> [default_child_item, separator_item] + child_items</code> </li> <li class="never" data-hits="" data-linenumber="64"> @@ -9132,12 +9126,12 @@ <span class="hits">1</span> <code class="ruby"> def menu_list</code> </li> - <li class="covered" data-hits="4" data-linenumber="67"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="67"> + <span class="hits">3</span> <code class="ruby"> view.content_tag :ul, menu_items.join.html_safe, :class =&gt; &#39;menu&#39;, :id =&gt; &quot;allowed_children_#{id}&quot;</code> </li> <li class="never" data-hits="" data-linenumber="68"> @@ -9156,12 +9150,12 @@ <span class="hits">1</span> <code class="ruby"> def remove_link</code> </li> - <li class="covered" data-hits="4" data-linenumber="71"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="71"> + <span class="hits">3</span> <code class="ruby"> view.link_to view.image(&#39;minus&#39;) + &#39; &#39; + I18n.t(&#39;remove&#39;), view.remove_admin_page_url(self), :class =&gt; &quot;action&quot;</code> </li> <li class="never" data-hits="" data-linenumber="72"> @@ -9180,12 +9174,12 @@ <span class="hits">1</span> <code class="ruby"> def remove_option</code> </li> - <li class="covered" data-hits="4" data-linenumber="75"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="75"> + <span class="hits">3</span> <code class="ruby"> remove_link</code> </li> <li class="never" data-hits="" data-linenumber="76"> @@ -9204,12 +9198,12 @@ <span class="hits">1</span> <code class="ruby"> def add_child_disabled?</code> </li> - <li class="covered" data-hits="4" data-linenumber="79"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="79"> + <span class="hits">3</span> <code class="ruby"> allowed_child_classes.size == 0</code> </li> <li class="never" data-hits="" data-linenumber="80"> @@ -9276,12 +9270,12 @@ <span class="hits">1</span> <code class="ruby"> def add_child_link_with_menu_hook</code> </li> - <li class="covered" data-hits="4" data-linenumber="91"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="91"> + <span class="hits">3</span> <code class="ruby"> view.link_to((view.image(&#39;plus&#39;) + &#39; Add Child&#39;), &quot;#allowed_children_#{id}&quot;, :class =&gt; &quot;action dropdown&quot;)</code> </li> <li class="never" data-hits="" data-linenumber="92"> @@ -9300,12 +9294,12 @@ <span class="hits">1</span> <code class="ruby"> def add_child_menu</code> </li> - <li class="covered" data-hits="4" data-linenumber="95"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="95"> + <span class="hits">3</span> <code class="ruby"> menu_list</code> </li> <li class="never" data-hits="" data-linenumber="96"> @@ -9324,12 +9318,12 @@ <span class="hits">1</span> <code class="ruby"> def add_child_link_with_menu</code> </li> - <li class="covered" data-hits="4" data-linenumber="99"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="99"> + <span class="hits">3</span> <code class="ruby"> add_child_link_with_menu_hook + add_child_menu</code> </li> <li class="never" data-hits="" data-linenumber="100"> @@ -9348,12 +9342,12 @@ <span class="hits">1</span> <code class="ruby"> def add_child_option</code> </li> - <li class="covered" data-hits="4" data-linenumber="103"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="103"> + <span class="hits">3</span> <code class="ruby"> if add_child_disabled?</code> </li> <li class="missed" data-hits="0" data-linenumber="104"> @@ -9366,12 +9360,12 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="4" data-linenumber="106"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="106"> + <span class="hits">3</span> <code class="ruby"> if allowed_child_classes.size == 1</code> </li> <li class="missed" data-hits="0" data-linenumber="107"> @@ -9384,12 +9378,12 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="4" data-linenumber="109"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="109"> + <span class="hits">3</span> <code class="ruby"> add_child_link_with_menu</code> </li> <li class="never" data-hits="" data-linenumber="110"> @@ -9432,12 +9426,12 @@ <span class="hits">1</span> <code class="ruby"> def clean_page_description(page_class)</code> </li> - <li class="covered" data-hits="8" data-linenumber="117"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="117"> + <span class="hits">6</span> <code class="ruby"> page_class.description.to_s.strip.gsub(/\t/,&#39;&#39;).gsub(/\s+/,&#39; &#39;)</code> </li> <li class="never" data-hits="" data-linenumber="118"> @@ -9456,12 +9450,12 @@ <span class="hits">1</span> <code class="ruby"> def menu_item(child_class)</code> </li> - <li class="covered" data-hits="8" data-linenumber="121"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="121"> + <span class="hits">6</span> <code class="ruby"> view.content_tag(:li, menu_link(child_class))</code> </li> <li class="never" data-hits="" data-linenumber="122"> @@ -9480,30 +9474,30 @@ <span class="hits">1</span> <code class="ruby"> def menu_link(child_class)</code> </li> - <li class="covered" data-hits="8" data-linenumber="125"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="125"> + <span class="hits">6</span> <code class="ruby"> title = clean_page_description(child_class)</code> </li> - <li class="covered" data-hits="8" data-linenumber="126"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="126"> + <span class="hits">6</span> <code class="ruby"> path = view.new_admin_page_child_path(self, :page_class =&gt; child_class.name)</code> </li> - <li class="covered" data-hits="8" data-linenumber="127"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="127"> + <span class="hits">6</span> <code class="ruby"> text = link_text_for_child_class(child_class.name)</code> </li> - <li class="covered" data-hits="8" data-linenumber="128"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="128"> + <span class="hits">6</span> <code class="ruby"> view.link_to(text, path, :title =&gt; title)</code> </li> <li class="never" data-hits="" data-linenumber="129"> @@ -9522,48 +9516,48 @@ <span class="hits">1</span> <code class="ruby"> def link_text_for_child_class(given_class_name)</code> </li> - <li class="covered" data-hits="8" data-linenumber="132"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="132"> + <span class="hits">6</span> <code class="ruby"> translation_key = if given_class_name == &#39;Page&#39; || given_class_name.blank?</code> </li> - <li class="covered" data-hits="4" data-linenumber="133"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="133"> + <span class="hits">3</span> <code class="ruby"> &#39;normal_page&#39;</code> </li> <li class="never" data-hits="" data-linenumber="134"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="4" data-linenumber="135"> - <span class="hits">4</span> + <li class="covered" data-hits="3" data-linenumber="135"> + <span class="hits">3</span> <code class="ruby"> given_class_name.sub(&#39;Page&#39;,&#39;&#39;).underscore</code> </li> <li class="never" data-hits="" data-linenumber="136"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="8" data-linenumber="137"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="137"> + <span class="hits">6</span> <code class="ruby"> fallback = given_class_name == &#39;Page&#39; ? &#39;Page&#39; : given_class_name.sub(&#39;Page&#39;,&#39;&#39;).titleize</code> </li> - <li class="covered" data-hits="8" data-linenumber="138"> - <span class="hits">8</span> + <li class="covered" data-hits="6" data-linenumber="138"> + <span class="hits">6</span> <code class="ruby"> I18n.t(translation_key, :default =&gt; fallback)</code> </li> <li class="never" data-hits="" data-linenumber="139"> @@ -9579,318 +9573,19 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="802c290d3237e413d582c6e3df59d0b1a783c364"> + <div class="source_table" id="49c0d6cdd80063237788139caa212ff3b99f0569"> <div class="header"> - <h3>app/models/page_context.rb</h3> - <h4><span class="red">62.07 %</span> covered</h4> - <div> - <b>29</b> relevant lines. - <span class="green"><b>18</b> lines covered</span> and - <span class="red"><b>11</b> lines missed.</span> - </div> - </div> - - <pre> - <ol> - - <li class="covered" data-hits="1" data-linenumber="1"> - <span class="hits">1</span> - - <code class="ruby">class PageContext &lt; Radius::Context</code> - </li> - - <li class="never" data-hits="" data-linenumber="2"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="3"> - <span class="hits">1</span> - - <code class="ruby"> attr_reader :page</code> - </li> - - <li class="never" data-hits="" data-linenumber="4"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="5"> - <span class="hits">1</span> - - <code class="ruby"> def initialize(page)</code> - </li> - - <li class="covered" data-hits="2" data-linenumber="6"> - <span class="hits">2</span> - - <code class="ruby"> super</code> - </li> - - <li class="covered" data-hits="2" data-linenumber="7"> - <span class="hits">2</span> - - <code class="ruby"> @page = page</code> - </li> - - <li class="covered" data-hits="2" data-linenumber="8"> - <span class="hits">2</span> - - <code class="ruby"> globals.page = @page</code> - </li> - - <li class="covered" data-hits="2" data-linenumber="9"> - <span class="hits">2</span> - - <code class="ruby"> page.tags.each do |name|</code> - </li> - - <li class="covered" data-hits="162" data-linenumber="10"> - <span class="hits">162</span> - - <code class="ruby"> define_tag(name) { |tag_binding| page.render_tag(name, tag_binding) }</code> - </li> - - <li class="never" data-hits="" data-linenumber="11"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="12"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="13"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="14"> - <span class="hits">1</span> - - <code class="ruby"> def dup</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="15"> - <span class="hits">1</span> - - <code class="ruby"> rv = self.class.new(page)</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="16"> - <span class="hits">1</span> - - <code class="ruby"> rv.globals = globals.dup</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="17"> - <span class="hits">1</span> - - <code class="ruby"> rv.definitions = definitions.dup</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="18"> - <span class="hits">1</span> - - <code class="ruby"> rv</code> - </li> - - <li class="never" data-hits="" data-linenumber="19"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="20"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="21"> - <span class="hits">1</span> - - <code class="ruby"> def render_tag(name, attributes = {}, &amp;block)</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="22"> - - - <code class="ruby"> binding = @tag_binding_stack.last</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="23"> - - - <code class="ruby"> locals = binding ? binding.locals : globals</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="24"> - - - <code class="ruby"> set_process_variables(locals.page)</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="25"> - - - <code class="ruby"> super</code> - </li> - - <li class="never" data-hits="" data-linenumber="26"> - - - <code class="ruby"> rescue Exception =&gt; e</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="27"> - - - <code class="ruby"> raise e if raise_errors?</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="28"> - - - <code class="ruby"> @tag_binding_stack.pop unless @tag_binding_stack.last == binding</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="29"> - - - <code class="ruby"> render_error_message(e.message)</code> - </li> - - <li class="never" data-hits="" data-linenumber="30"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="31"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="32"> - <span class="hits">1</span> - - <code class="ruby"> private</code> - </li> - - <li class="never" data-hits="" data-linenumber="33"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="34"> - <span class="hits">1</span> - - <code class="ruby"> def render_error_message(message)</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="35"> - - - <code class="ruby"> &quot;&lt;div&gt;&lt;strong&gt;#{message}&lt;/strong&gt;&lt;/div&gt;&quot;</code> - </li> - - <li class="never" data-hits="" data-linenumber="36"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="37"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="38"> - <span class="hits">1</span> - - <code class="ruby"> def set_process_variables(page)</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="39"> - - - <code class="ruby"> page.request ||= @page.request</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="40"> - - - <code class="ruby"> page.response ||= @page.response</code> - </li> - - <li class="never" data-hits="" data-linenumber="41"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="42"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="43"> - <span class="hits">1</span> - - <code class="ruby"> def raise_errors?</code> - </li> - - <li class="missed" data-hits="0" data-linenumber="44"> - - - <code class="ruby"> Rails.env != &#39;production&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="45"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="46"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="47"> - - - <code class="ruby">end</code> - </li> - - </ol> - </pre> -</div> - - <div class="source_table" id="ee99abb95d276df654be743872e18cebe9cd7a76"> - <div class="header"> <h3>app/models/page_field.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> - <b>3</b> relevant lines. - <span class="green"><b>3</b> lines covered</span> and + <b>2</b> relevant lines. + <span class="green"><b>2</b> lines covered</span> and <span class="red"><b>0</b> lines missed.</span> </div> </div> <pre> @@ -9903,36 +9598,31 @@ </li> <li class="covered" data-hits="1" data-linenumber="2"> <span class="hits">1</span> - <code class="ruby"> attr_accessible :name, :content</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="3"> - <span class="hits">1</span> - <code class="ruby"> validates_presence_of :name</code> </li> - <li class="never" data-hits="" data-linenumber="4"> + <li class="never" data-hits="" data-linenumber="3"> <code class="ruby">end</code> </li> </ol> </pre> </div> + - <div class="source_table" id="a305f6d4632c6314af7cf73ec29de843155d1b7c"> + <div class="source_table" id="bd093ce629db1b261871cea3d4882c14d0edc165"> <div class="header"> <h3>app/models/page_part.rb</h3> - <h4><span class="yellow">90.0 %</span> covered</h4> + <h4><span class="yellow">88.89 %</span> covered</h4> <div> - <b>10</b> relevant lines. - <span class="green"><b>9</b> lines covered</span> and + <b>9</b> relevant lines. + <span class="green"><b>8</b> lines covered</span> and <span class="red"><b>1</b> lines missed.</span> </div> </div> <pre> @@ -9942,129 +9632,124 @@ <span class="hits">1</span> <code class="ruby">class PagePart &lt; ActiveRecord::Base</code> </li> - <li class="covered" data-hits="1" data-linenumber="2"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="2"> - <code class="ruby"> attr_accessible :name, :filter_id, :content</code> - </li> - - <li class="never" data-hits="" data-linenumber="3"> - <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="4"> + <li class="never" data-hits="" data-linenumber="3"> <code class="ruby"> # Default Order</code> </li> - <li class="covered" data-hits="37" data-linenumber="5"> - <span class="hits">37</span> + <li class="covered" data-hits="17" data-linenumber="4"> + <span class="hits">17</span> <code class="ruby"> default_scope {order(&quot;name&quot;)}</code> </li> - <li class="never" data-hits="" data-linenumber="6"> + <li class="never" data-hits="" data-linenumber="5"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="7"> + <li class="never" data-hits="" data-linenumber="6"> <code class="ruby"> # Associations</code> </li> - <li class="covered" data-hits="1" data-linenumber="8"> + <li class="covered" data-hits="1" data-linenumber="7"> <span class="hits">1</span> <code class="ruby"> belongs_to :page</code> </li> - <li class="never" data-hits="" data-linenumber="9"> + <li class="never" data-hits="" data-linenumber="8"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="10"> + <li class="never" data-hits="" data-linenumber="9"> <code class="ruby"> # Validations</code> </li> - <li class="covered" data-hits="1" data-linenumber="11"> + <li class="covered" data-hits="1" data-linenumber="10"> <span class="hits">1</span> <code class="ruby"> validates_presence_of :name</code> </li> - <li class="covered" data-hits="1" data-linenumber="12"> + <li class="covered" data-hits="1" data-linenumber="11"> <span class="hits">1</span> <code class="ruby"> validates_length_of :name, :maximum =&gt; 100</code> </li> - <li class="covered" data-hits="1" data-linenumber="13"> + <li class="covered" data-hits="1" data-linenumber="12"> <span class="hits">1</span> <code class="ruby"> validates_length_of :filter_id, :maximum =&gt; 25, :allow_nil =&gt; true</code> </li> - <li class="never" data-hits="" data-linenumber="14"> + <li class="never" data-hits="" data-linenumber="13"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="15"> + <li class="covered" data-hits="1" data-linenumber="14"> <span class="hits">1</span> <code class="ruby"> object_id_attr :filter, TextFilter</code> </li> - <li class="never" data-hits="" data-linenumber="16"> + <li class="never" data-hits="" data-linenumber="15"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="17"> + <li class="covered" data-hits="1" data-linenumber="16"> <span class="hits">1</span> <code class="ruby"> def after_initialize</code> </li> - <li class="missed" data-hits="0" data-linenumber="18"> + <li class="missed" data-hits="0" data-linenumber="17"> <code class="ruby"> self.filter_id ||= TrustyCms::Config[&#39;defaults.page.filter&#39;] if new_record?</code> </li> - <li class="never" data-hits="" data-linenumber="19"> + <li class="never" data-hits="" data-linenumber="18"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="20"> + <li class="never" data-hits="" data-linenumber="19"> <code class="ruby">end</code> </li> </ol> </pre> </div> + - <div class="source_table" id="7388d43ba91c2a28d73545a6809e9d998ff37d21"> + <div class="source_table" id="7bbb7a658abedc8bd08027742a2caa6df93f5d28"> <div class="header"> <h3>app/models/status.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>18</b> relevant lines. @@ -10128,12 +9813,12 @@ <span class="hits">1</span> <code class="ruby"> def symbol</code> </li> - <li class="covered" data-hits="85" data-linenumber="10"> - <span class="hits">85</span> + <li class="covered" data-hits="61" data-linenumber="10"> + <span class="hits">61</span> <code class="ruby"> @name.to_s.downcase.intern</code> </li> <li class="never" data-hits="" data-linenumber="11"> @@ -10152,12 +9837,12 @@ <span class="hits">1</span> <code class="ruby"> def self.[](value)</code> </li> - <li class="covered" data-hits="112" data-linenumber="14"> - <span class="hits">112</span> + <li class="covered" data-hits="80" data-linenumber="14"> + <span class="hits">80</span> <code class="ruby"> @@statuses.find { |status| status.symbol == value.to_s.downcase.intern }</code> </li> <li class="never" data-hits="" data-linenumber="15"> @@ -10176,12 +9861,12 @@ <span class="hits">1</span> <code class="ruby"> def self.find(id)</code> </li> - <li class="covered" data-hits="34" data-linenumber="18"> - <span class="hits">34</span> + <li class="covered" data-hits="24" data-linenumber="18"> + <span class="hits">24</span> <code class="ruby"> @@statuses.find { |status| status.id.to_s == id.to_s }</code> </li> <li class="never" data-hits="" data-linenumber="19"> @@ -10200,12 +9885,12 @@ <span class="hits">1</span> <code class="ruby"> def self.find_all</code> </li> - <li class="covered" data-hits="11" data-linenumber="22"> - <span class="hits">11</span> + <li class="covered" data-hits="9" data-linenumber="22"> + <span class="hits">9</span> <code class="ruby"> @@statuses.dup</code> </li> <li class="never" data-hits="" data-linenumber="23"> @@ -10224,12 +9909,12 @@ <span class="hits">1</span> <code class="ruby"> def self.selectable</code> </li> - <li class="covered" data-hits="11" data-linenumber="26"> - <span class="hits">11</span> + <li class="covered" data-hits="9" data-linenumber="26"> + <span class="hits">9</span> <code class="ruby"> find_all - [self[&#39;Scheduled&#39;]]</code> </li> <li class="never" data-hits="" data-linenumber="27"> @@ -10323,19 +10008,20 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="a3d0e95dccc6cc402608c949f61537589888f7d7"> + <div class="source_table" id="f75912d7024ea4b17e23b6212deece9f8d099be8"> <div class="header"> <h3>app/models/text_filter.rb</h3> - <h4><span class="red">68.75 %</span> covered</h4> + <h4><span class="red">62.5 %</span> covered</h4> <div> <b>16</b> relevant lines. - <span class="green"><b>11</b> lines covered</span> and - <span class="red"><b>5</b> lines missed.</span> + <span class="green"><b>10</b> lines covered</span> and + <span class="red"><b>6</b> lines missed.</span> </div> </div> <pre> <ol> @@ -10380,13 +10066,13 @@ <span class="hits">1</span> <code class="ruby"> def filter(text)</code> </li> - <li class="covered" data-hits="1" data-linenumber="8"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="8"> + <code class="ruby"> text</code> </li> <li class="never" data-hits="" data-linenumber="9"> @@ -10527,18 +10213,19 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="3245bdc6bf68c4799ba1a1df23d11fe7c154286c"> + <div class="source_table" id="81a323fefe55031208374870d21243beae4e4565"> <div class="header"> <h3>app/models/user.rb</h3> - <h4><span class="yellow">82.69 %</span> covered</h4> + <h4><span class="yellow">82.35 %</span> covered</h4> <div> - <b>52</b> relevant lines. - <span class="green"><b>43</b> lines covered</span> and + <b>51</b> relevant lines. + <span class="green"><b>42</b> lines covered</span> and <span class="red"><b>9</b> lines missed.</span> </div> </div> <pre> @@ -10566,573 +10253,568 @@ <span class="hits">1</span> <code class="ruby"> has_many :pages, :foreign_key =&gt; :created_by_id</code> </li> - <li class="covered" data-hits="1" data-linenumber="5"> - <span class="hits">1</span> + <li class="never" data-hits="" data-linenumber="5"> - <code class="ruby"> attr_protected &#39;why_is_this_needed&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="6"> - <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="7"> + <li class="never" data-hits="" data-linenumber="6"> <code class="ruby"> # Default Order</code> </li> - <li class="covered" data-hits="28" data-linenumber="8"> - <span class="hits">28</span> + <li class="covered" data-hits="26" data-linenumber="7"> + <span class="hits">26</span> <code class="ruby"> default_scope {order(&quot;name&quot;)}</code> </li> - <li class="never" data-hits="" data-linenumber="9"> + <li class="never" data-hits="" data-linenumber="8"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="10"> + <li class="never" data-hits="" data-linenumber="9"> <code class="ruby"> # Associations</code> </li> - <li class="covered" data-hits="1" data-linenumber="11"> + <li class="covered" data-hits="1" data-linenumber="10"> <span class="hits">1</span> <code class="ruby"> belongs_to :created_by, :class_name =&gt; &#39;User&#39;</code> </li> - <li class="covered" data-hits="1" data-linenumber="12"> + <li class="covered" data-hits="1" data-linenumber="11"> <span class="hits">1</span> <code class="ruby"> belongs_to :updated_by, :class_name =&gt; &#39;User&#39;</code> </li> - <li class="never" data-hits="" data-linenumber="13"> + <li class="never" data-hits="" data-linenumber="12"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="14"> + <li class="never" data-hits="" data-linenumber="13"> <code class="ruby"> # Validations</code> </li> - <li class="covered" data-hits="1" data-linenumber="15"> + <li class="covered" data-hits="1" data-linenumber="14"> <span class="hits">1</span> <code class="ruby"> validates_uniqueness_of :login</code> </li> - <li class="never" data-hits="" data-linenumber="16"> + <li class="never" data-hits="" data-linenumber="15"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="17"> + <li class="covered" data-hits="1" data-linenumber="16"> <span class="hits">1</span> <code class="ruby"> validates_confirmation_of :password, :if =&gt; :confirm_password?</code> </li> - <li class="never" data-hits="" data-linenumber="18"> + <li class="never" data-hits="" data-linenumber="17"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="19"> + <li class="covered" data-hits="1" data-linenumber="18"> <span class="hits">1</span> <code class="ruby"> validates_presence_of :name, :login</code> </li> - <li class="covered" data-hits="1" data-linenumber="20"> + <li class="covered" data-hits="1" data-linenumber="19"> <span class="hits">1</span> <code class="ruby"> validates_presence_of :password, :password_confirmation, :if =&gt; :new_record?</code> </li> - <li class="never" data-hits="" data-linenumber="21"> + <li class="never" data-hits="" data-linenumber="20"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="22"> + <li class="never" data-hits="" data-linenumber="21"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="23"> + <li class="covered" data-hits="1" data-linenumber="22"> <span class="hits">1</span> <code class="ruby"> validates_length_of :name, :maximum =&gt; 100, :allow_nil =&gt; true</code> </li> - <li class="covered" data-hits="1" data-linenumber="24"> + <li class="covered" data-hits="1" data-linenumber="23"> <span class="hits">1</span> <code class="ruby"> validates_length_of :login, :within =&gt; 3..40, :allow_nil =&gt; true</code> </li> - <li class="covered" data-hits="1" data-linenumber="25"> + <li class="covered" data-hits="1" data-linenumber="24"> <span class="hits">1</span> <code class="ruby"> validates_length_of :password, :within =&gt; 5..40, :allow_nil =&gt; true, :if =&gt; :validate_length_of_password?</code> </li> - <li class="covered" data-hits="1" data-linenumber="26"> + <li class="covered" data-hits="1" data-linenumber="25"> <span class="hits">1</span> <code class="ruby"> validates_length_of :email, :maximum =&gt; 255, :allow_nil =&gt; true</code> </li> - <li class="never" data-hits="" data-linenumber="27"> + <li class="never" data-hits="" data-linenumber="26"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="28"> + <li class="covered" data-hits="1" data-linenumber="27"> <span class="hits">1</span> <code class="ruby"> attr_writer :confirm_password</code> </li> - <li class="never" data-hits="" data-linenumber="29"> + <li class="never" data-hits="" data-linenumber="28"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="30"> + <li class="covered" data-hits="1" data-linenumber="29"> <span class="hits">1</span> <code class="ruby"> def has_role?(role)</code> </li> - <li class="covered" data-hits="140" data-linenumber="31"> - <span class="hits">140</span> + <li class="covered" data-hits="128" data-linenumber="30"> + <span class="hits">128</span> <code class="ruby"> respond_to?(&quot;#{role}?&quot;) &amp;&amp; send(&quot;#{role}?&quot;)</code> </li> - <li class="never" data-hits="" data-linenumber="32"> + <li class="never" data-hits="" data-linenumber="31"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="33"> + <li class="never" data-hits="" data-linenumber="32"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="34"> + <li class="covered" data-hits="1" data-linenumber="33"> <span class="hits">1</span> <code class="ruby"> def sha1(phrase)</code> </li> - <li class="covered" data-hits="20" data-linenumber="35"> - <span class="hits">20</span> + <li class="covered" data-hits="19" data-linenumber="34"> + <span class="hits">19</span> <code class="ruby"> Digest::SHA1.hexdigest(&quot;--#{salt}--#{phrase}--&quot;)</code> </li> - <li class="never" data-hits="" data-linenumber="36"> + <li class="never" data-hits="" data-linenumber="35"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="37"> + <li class="never" data-hits="" data-linenumber="36"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="38"> + <li class="covered" data-hits="1" data-linenumber="37"> <span class="hits">1</span> <code class="ruby"> def self.authenticate(login_or_email, password)</code> </li> - <li class="covered" data-hits="21" data-linenumber="39"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="38"> + <span class="hits">20</span> <code class="ruby"> user = where([&quot;login = ? OR email = ?&quot;, login_or_email, login_or_email]).first</code> </li> - <li class="covered" data-hits="21" data-linenumber="40"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="39"> + <span class="hits">20</span> <code class="ruby"> user if user &amp;&amp; user.authenticated?(password)</code> </li> - <li class="never" data-hits="" data-linenumber="41"> + <li class="never" data-hits="" data-linenumber="40"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="42"> + <li class="never" data-hits="" data-linenumber="41"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="43"> + <li class="covered" data-hits="1" data-linenumber="42"> <span class="hits">1</span> <code class="ruby"> def authenticated?(password)</code> </li> - <li class="covered" data-hits="20" data-linenumber="44"> - <span class="hits">20</span> + <li class="covered" data-hits="19" data-linenumber="43"> + <span class="hits">19</span> <code class="ruby"> self.password == sha1(password)</code> </li> - <li class="never" data-hits="" data-linenumber="45"> + <li class="never" data-hits="" data-linenumber="44"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="46"> + <li class="never" data-hits="" data-linenumber="45"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="47"> + <li class="covered" data-hits="1" data-linenumber="46"> <span class="hits">1</span> <code class="ruby"> def after_initialize</code> </li> - <li class="missed" data-hits="0" data-linenumber="48"> + <li class="missed" data-hits="0" data-linenumber="47"> <code class="ruby"> @confirm_password = true</code> </li> - <li class="never" data-hits="" data-linenumber="49"> + <li class="never" data-hits="" data-linenumber="48"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="50"> + <li class="never" data-hits="" data-linenumber="49"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="51"> + <li class="covered" data-hits="1" data-linenumber="50"> <span class="hits">1</span> <code class="ruby"> def confirm_password?</code> </li> - <li class="covered" data-hits="3" data-linenumber="52"> + <li class="covered" data-hits="3" data-linenumber="51"> <span class="hits">3</span> <code class="ruby"> @confirm_password</code> </li> - <li class="never" data-hits="" data-linenumber="53"> + <li class="never" data-hits="" data-linenumber="52"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="54"> + <li class="never" data-hits="" data-linenumber="53"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="55"> + <li class="covered" data-hits="1" data-linenumber="54"> <span class="hits">1</span> <code class="ruby"> def remember_me</code> </li> - <li class="missed" data-hits="0" data-linenumber="56"> + <li class="missed" data-hits="0" data-linenumber="55"> <code class="ruby"> update_attribute(:session_token, sha1(Time.now + TrustyCms::Config[&#39;session_timeout&#39;].to_i)) unless self.session_token?</code> </li> - <li class="never" data-hits="" data-linenumber="57"> + <li class="never" data-hits="" data-linenumber="56"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="58"> + <li class="never" data-hits="" data-linenumber="57"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="59"> + <li class="covered" data-hits="1" data-linenumber="58"> <span class="hits">1</span> <code class="ruby"> def forget_me</code> </li> - <li class="covered" data-hits="1" data-linenumber="60"> + <li class="covered" data-hits="1" data-linenumber="59"> <span class="hits">1</span> <code class="ruby"> update_attribute(:session_token, nil)</code> </li> - <li class="never" data-hits="" data-linenumber="61"> + <li class="never" data-hits="" data-linenumber="60"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="62"> + <li class="never" data-hits="" data-linenumber="61"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="63"> + <li class="covered" data-hits="1" data-linenumber="62"> <span class="hits">1</span> <code class="ruby"> def send_password_reset</code> </li> - <li class="missed" data-hits="0" data-linenumber="64"> + <li class="missed" data-hits="0" data-linenumber="63"> <code class="ruby"> generate_token(:password_reset_token)</code> </li> - <li class="missed" data-hits="0" data-linenumber="65"> + <li class="missed" data-hits="0" data-linenumber="64"> <code class="ruby"> update_attribute(:password_reset_sent_at, Time.zone.now)</code> </li> - <li class="missed" data-hits="0" data-linenumber="66"> + <li class="missed" data-hits="0" data-linenumber="65"> <code class="ruby"> PasswordMailer.password_reset(self).deliver_now</code> </li> - <li class="never" data-hits="" data-linenumber="67"> + <li class="never" data-hits="" data-linenumber="66"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="68"> + <li class="never" data-hits="" data-linenumber="67"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="69"> + <li class="covered" data-hits="1" data-linenumber="68"> <span class="hits">1</span> <code class="ruby"> private</code> </li> - <li class="never" data-hits="" data-linenumber="70"> + <li class="never" data-hits="" data-linenumber="69"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="71"> + <li class="covered" data-hits="1" data-linenumber="70"> <span class="hits">1</span> <code class="ruby"> def generate_token(column)</code> </li> - <li class="missed" data-hits="0" data-linenumber="72"> + <li class="missed" data-hits="0" data-linenumber="71"> <code class="ruby"> self[column] = SecureRandom.urlsafe_base64 if User.exists?(column =&gt; self[column])</code> </li> - <li class="never" data-hits="" data-linenumber="73"> + <li class="never" data-hits="" data-linenumber="72"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="74"> + <li class="never" data-hits="" data-linenumber="73"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="75"> + <li class="covered" data-hits="1" data-linenumber="74"> <span class="hits">1</span> <code class="ruby"> def validate_length_of_password?</code> </li> - <li class="covered" data-hits="3" data-linenumber="76"> + <li class="covered" data-hits="3" data-linenumber="75"> <span class="hits">3</span> <code class="ruby"> new_record? or not password.to_s.empty?</code> </li> - <li class="never" data-hits="" data-linenumber="77"> + <li class="never" data-hits="" data-linenumber="76"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="78"> + <li class="never" data-hits="" data-linenumber="77"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="79"> + <li class="covered" data-hits="1" data-linenumber="78"> <span class="hits">1</span> <code class="ruby"> before_create :encrypt_password</code> </li> - <li class="covered" data-hits="1" data-linenumber="80"> + <li class="covered" data-hits="1" data-linenumber="79"> <span class="hits">1</span> <code class="ruby"> def encrypt_password</code> </li> - <li class="missed" data-hits="0" data-linenumber="81"> + <li class="missed" data-hits="0" data-linenumber="80"> <code class="ruby"> self.salt = Digest::SHA1.hexdigest(&quot;--#{Time.now}--#{login}--sweet harmonious biscuits--&quot;)</code> </li> - <li class="missed" data-hits="0" data-linenumber="82"> + <li class="missed" data-hits="0" data-linenumber="81"> <code class="ruby"> self.password = sha1(password)</code> </li> - <li class="never" data-hits="" data-linenumber="83"> + <li class="never" data-hits="" data-linenumber="82"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="84"> + <li class="never" data-hits="" data-linenumber="83"> <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="85"> + <li class="covered" data-hits="1" data-linenumber="84"> <span class="hits">1</span> <code class="ruby"> before_update :encrypt_password_unless_empty_or_unchanged</code> </li> - <li class="covered" data-hits="1" data-linenumber="86"> + <li class="covered" data-hits="1" data-linenumber="85"> <span class="hits">1</span> <code class="ruby"> def encrypt_password_unless_empty_or_unchanged</code> </li> - <li class="covered" data-hits="2" data-linenumber="87"> - <span class="hits">2</span> + <li class="covered" data-hits="1" data-linenumber="86"> + <span class="hits">1</span> <code class="ruby"> user = self.class.find(self.id)</code> </li> - <li class="covered" data-hits="2" data-linenumber="88"> - <span class="hits">2</span> + <li class="covered" data-hits="1" data-linenumber="87"> + <span class="hits">1</span> <code class="ruby"> case password</code> </li> - <li class="never" data-hits="" data-linenumber="89"> + <li class="never" data-hits="" data-linenumber="88"> <code class="ruby"> when &#39;&#39;</code> </li> - <li class="covered" data-hits="1" data-linenumber="90"> + <li class="covered" data-hits="1" data-linenumber="89"> <span class="hits">1</span> <code class="ruby"> self.password = user.password</code> </li> - <li class="never" data-hits="" data-linenumber="91"> + <li class="never" data-hits="" data-linenumber="90"> <code class="ruby"> when user.password</code> </li> - <li class="never" data-hits="" data-linenumber="92"> + <li class="never" data-hits="" data-linenumber="91"> <code class="ruby"> else</code> </li> - <li class="missed" data-hits="0" data-linenumber="93"> + <li class="missed" data-hits="0" data-linenumber="92"> <code class="ruby"> encrypt_password</code> </li> - <li class="never" data-hits="" data-linenumber="94"> + <li class="never" data-hits="" data-linenumber="93"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="95"> + <li class="never" data-hits="" data-linenumber="94"> <code class="ruby"> end</code> </li> - <li class="never" data-hits="" data-linenumber="96"> + <li class="never" data-hits="" data-linenumber="95"> <code class="ruby"></code> </li> - <li class="never" data-hits="" data-linenumber="97"> + <li class="never" data-hits="" data-linenumber="96"> <code class="ruby">end</code> </li> </ol> </pre> </div> + - <div class="source_table" id="224090690cd46a1b82b33b9876817d1d65b88e42"> + <div class="source_table" id="8e9451d3350618c4464083f2173ec92c1cbba22a"> <div class="header"> <h3>app/models/user_action_observer.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>14</b> relevant lines. @@ -11166,12 +10848,12 @@ <span class="hits">1</span> <code class="ruby"> def current_user=(user)</code> </li> - <li class="covered" data-hits="151" data-linenumber="5"> - <span class="hits">151</span> + <li class="covered" data-hits="135" data-linenumber="5"> + <span class="hits">135</span> <code class="ruby"> self.class.current_user = user</code> </li> <li class="never" data-hits="" data-linenumber="6"> @@ -11184,12 +10866,12 @@ <span class="hits">1</span> <code class="ruby"> def self.current_user=(user)</code> </li> - <li class="covered" data-hits="151" data-linenumber="8"> - <span class="hits">151</span> + <li class="covered" data-hits="135" data-linenumber="8"> + <span class="hits">135</span> <code class="ruby"> Thread.current[:current_user] = user</code> </li> <li class="never" data-hits="" data-linenumber="9"> @@ -11208,12 +10890,12 @@ <span class="hits">1</span> <code class="ruby"> def current_user</code> </li> - <li class="covered" data-hits="9" data-linenumber="12"> - <span class="hits">9</span> + <li class="covered" data-hits="8" data-linenumber="12"> + <span class="hits">8</span> <code class="ruby"> self.class.current_user</code> </li> <li class="never" data-hits="" data-linenumber="13"> @@ -11226,12 +10908,12 @@ <span class="hits">1</span> <code class="ruby"> def self.current_user</code> </li> - <li class="covered" data-hits="9" data-linenumber="15"> - <span class="hits">9</span> + <li class="covered" data-hits="8" data-linenumber="15"> + <span class="hits">8</span> <code class="ruby"> Thread.current[:current_user]</code> </li> <li class="never" data-hits="" data-linenumber="16"> @@ -11274,12 +10956,12 @@ <span class="hits">1</span> <code class="ruby"> def before_update(model)</code> </li> - <li class="covered" data-hits="2" data-linenumber="23"> - <span class="hits">2</span> + <li class="covered" data-hits="1" data-linenumber="23"> + <span class="hits">1</span> <code class="ruby"> model.updated_by = self.current_user</code> </li> <li class="never" data-hits="" data-linenumber="24"> @@ -11295,12 +10977,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="d68b3b291e170af9809ca2750a36de47a6d1f510"> + <div class="source_table" id="6b2b4e11dc5e71e9e79d239984b30738d065981e"> <div class="header"> <h3>lib/login_system.rb</h3> <h4><span class="red">78.95 %</span> covered</h4> <div> <b>76</b> relevant lines. @@ -11337,17 +11020,17 @@ </li> <li class="covered" data-hits="1" data-linenumber="5"> <span class="hits">1</span> - <code class="ruby"> prepend_before_filter :authenticate</code> + <code class="ruby"> prepend_before_action :authenticate</code> </li> <li class="covered" data-hits="1" data-linenumber="6"> <span class="hits">1</span> - <code class="ruby"> prepend_before_filter :authorize</code> + <code class="ruby"> prepend_before_action :authorize</code> </li> <li class="covered" data-hits="1" data-linenumber="7"> <span class="hits">1</span> @@ -11388,12 +11071,12 @@ <span class="hits">1</span> <code class="ruby"> def current_user</code> </li> - <li class="covered" data-hits="967" data-linenumber="14"> - <span class="hits">967</span> + <li class="covered" data-hits="861" data-linenumber="14"> + <span class="hits">861</span> <code class="ruby"> @current_user ||= (login_from_session || login_from_cookie || login_from_http)</code> </li> <li class="never" data-hits="" data-linenumber="15"> @@ -11412,24 +11095,24 @@ <span class="hits">1</span> <code class="ruby"> def current_user=(value=nil)</code> </li> - <li class="covered" data-hits="22" data-linenumber="18"> - <span class="hits">22</span> + <li class="covered" data-hits="21" data-linenumber="18"> + <span class="hits">21</span> <code class="ruby"> if value &amp;&amp; value.is_a?(User)</code> </li> - <li class="covered" data-hits="19" data-linenumber="19"> - <span class="hits">19</span> + <li class="covered" data-hits="18" data-linenumber="19"> + <span class="hits">18</span> <code class="ruby"> @current_user = value</code> </li> - <li class="covered" data-hits="19" data-linenumber="20"> - <span class="hits">19</span> + <li class="covered" data-hits="18" data-linenumber="20"> + <span class="hits">18</span> <code class="ruby"> session[&#39;user_id&#39;] = value.id</code> </li> <li class="never" data-hits="" data-linenumber="21"> @@ -11454,12 +11137,12 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="22" data-linenumber="25"> - <span class="hits">22</span> + <li class="covered" data-hits="21" data-linenumber="25"> + <span class="hits">21</span> <code class="ruby"> @current_user</code> </li> <li class="never" data-hits="" data-linenumber="26"> @@ -11484,66 +11167,66 @@ <code class="ruby"> #puts _process_action_callbacks.map(&amp;:filter)</code> </li> - <li class="covered" data-hits="81" data-linenumber="30"> - <span class="hits">81</span> + <li class="covered" data-hits="71" data-linenumber="30"> + <span class="hits">71</span> <code class="ruby"> if current_user</code> </li> - <li class="covered" data-hits="58" data-linenumber="31"> - <span class="hits">58</span> + <li class="covered" data-hits="49" data-linenumber="31"> + <span class="hits">49</span> <code class="ruby"> session[&#39;user_id&#39;] = current_user.id</code> </li> - <li class="covered" data-hits="58" data-linenumber="32"> - <span class="hits">58</span> + <li class="covered" data-hits="49" data-linenumber="32"> + <span class="hits">49</span> <code class="ruby"> true</code> </li> <li class="never" data-hits="" data-linenumber="33"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="23" data-linenumber="34"> - <span class="hits">23</span> + <li class="covered" data-hits="22" data-linenumber="34"> + <span class="hits">22</span> <code class="ruby"> session[:return_to] = request.original_url</code> </li> - <li class="covered" data-hits="23" data-linenumber="35"> - <span class="hits">23</span> + <li class="covered" data-hits="22" data-linenumber="35"> + <span class="hits">22</span> <code class="ruby"> respond_to do |format|</code> </li> - <li class="covered" data-hits="46" data-linenumber="36"> - <span class="hits">46</span> + <li class="covered" data-hits="44" data-linenumber="36"> + <span class="hits">44</span> <code class="ruby"> format.html { redirect_to login_url }</code> </li> - <li class="covered" data-hits="23" data-linenumber="37"> - <span class="hits">23</span> + <li class="covered" data-hits="22" data-linenumber="37"> + <span class="hits">22</span> <code class="ruby"> format.any(:xml,:json) { request_http_basic_authentication }</code> </li> <li class="never" data-hits="" data-linenumber="38"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="23" data-linenumber="39"> - <span class="hits">23</span> + <li class="covered" data-hits="22" data-linenumber="39"> + <span class="hits">22</span> <code class="ruby"> false</code> </li> <li class="never" data-hits="" data-linenumber="40"> @@ -11574,24 +11257,24 @@ <code class="ruby"> #puts _process_action_callbacks.map(&amp;:filter)</code> </li> - <li class="covered" data-hits="81" data-linenumber="45"> - <span class="hits">81</span> + <li class="covered" data-hits="71" data-linenumber="45"> + <span class="hits">71</span> <code class="ruby"> action = action_name.to_s.intern</code> </li> - <li class="covered" data-hits="81" data-linenumber="46"> - <span class="hits">81</span> + <li class="covered" data-hits="71" data-linenumber="46"> + <span class="hits">71</span> <code class="ruby"> if user_has_access_to_action?(action)</code> </li> - <li class="covered" data-hits="81" data-linenumber="47"> - <span class="hits">81</span> + <li class="covered" data-hits="71" data-linenumber="47"> + <span class="hits">71</span> <code class="ruby"> true</code> </li> <li class="never" data-hits="" data-linenumber="48"> @@ -11664,12 +11347,12 @@ <span class="hits">1</span> <code class="ruby"> def user_has_access_to_action?(action)</code> </li> - <li class="covered" data-hits="81" data-linenumber="60"> - <span class="hits">81</span> + <li class="covered" data-hits="71" data-linenumber="60"> + <span class="hits">71</span> <code class="ruby"> self.class.user_has_access_to_action?(current_user, action, self)</code> </li> <li class="never" data-hits="" data-linenumber="61"> @@ -11688,12 +11371,12 @@ <span class="hits">1</span> <code class="ruby"> def login_from_session</code> </li> - <li class="covered" data-hits="614" data-linenumber="64"> - <span class="hits">614</span> + <li class="covered" data-hits="578" data-linenumber="64"> + <span class="hits">578</span> <code class="ruby"> User.unscoped.find(session[&#39;user_id&#39;]) rescue nil</code> </li> <li class="never" data-hits="" data-linenumber="65"> @@ -11712,12 +11395,12 @@ <span class="hits">1</span> <code class="ruby"> def login_from_cookie</code> </li> - <li class="covered" data-hits="276" data-linenumber="68"> - <span class="hits">276</span> + <li class="covered" data-hits="264" data-linenumber="68"> + <span class="hits">264</span> <code class="ruby"> if !cookies[:session_token].blank? &amp;&amp; user = User.find_by_session_token(cookies[:session_token]) # don&#39;t find by empty value</code> </li> <li class="missed" data-hits="0" data-linenumber="69"> @@ -11760,14 +11443,14 @@ <span class="hits">1</span> <code class="ruby"> def login_from_http</code> </li> - <li class="covered" data-hits="276" data-linenumber="76"> - <span class="hits">276</span> + <li class="covered" data-hits="264" data-linenumber="76"> + <span class="hits">264</span> - <code class="ruby"> if [Mime::XML, Mime::JSON].include?(request.format)</code> + <code class="ruby"> if [Mime[:xml], Mime[:json]].include?(request.format)</code> </li> <li class="missed" data-hits="0" data-linenumber="77"> @@ -11841,17 +11524,17 @@ </li> <li class="covered" data-hits="2" data-linenumber="89"> <span class="hits">2</span> - <code class="ruby"> skip_before_filter :authenticate</code> + <code class="ruby"> skip_before_action :authenticate</code> </li> <li class="covered" data-hits="2" data-linenumber="90"> <span class="hits">2</span> - <code class="ruby"> skip_before_filter :authorize</code> + <code class="ruby"> skip_before_action :authorize</code> </li> <li class="never" data-hits="" data-linenumber="91"> @@ -11907,11 +11590,11 @@ </li> <li class="missed" data-hits="0" data-linenumber="100"> - <code class="ruby"> prepend_before_filter :authenticate, :authorize</code> + <code class="ruby"> prepend_before_action :authenticate, :authorize</code> </li> <li class="never" data-hits="" data-linenumber="101"> @@ -11994,12 +11677,12 @@ <span class="hits">1</span> <code class="ruby"> def controller_permissions</code> </li> - <li class="covered" data-hits="286" data-linenumber="115"> - <span class="hits">286</span> + <li class="covered" data-hits="256" data-linenumber="115"> + <span class="hits">256</span> <code class="ruby"> @controller_permissions ||= Hash.new { |h,k| h[k.to_s.intern] = Hash.new }</code> </li> <li class="never" data-hits="" data-linenumber="116"> @@ -12018,12 +11701,12 @@ <span class="hits">1</span> <code class="ruby"> def user_has_access_to_action?(user, action, instance=new)</code> </li> - <li class="covered" data-hits="256" data-linenumber="119"> - <span class="hits">256</span> + <li class="covered" data-hits="228" data-linenumber="119"> + <span class="hits">228</span> <code class="ruby"> permissions = controller_permissions[action.to_s.intern]</code> </li> <li class="never" data-hits="" data-linenumber="120"> @@ -12036,18 +11719,18 @@ <code class="ruby"> when allowed_roles = permissions[:when]</code> </li> - <li class="covered" data-hits="78" data-linenumber="122"> - <span class="hits">78</span> + <li class="covered" data-hits="72" data-linenumber="122"> + <span class="hits">72</span> <code class="ruby"> allowed_roles = [allowed_roles].flatten</code> </li> - <li class="covered" data-hits="218" data-linenumber="123"> - <span class="hits">218</span> + <li class="covered" data-hits="200" data-linenumber="123"> + <span class="hits">200</span> <code class="ruby"> user.present? ? allowed_roles.any? { |role| user.has_role?(role) } : false</code> </li> <li class="never" data-hits="" data-linenumber="124"> @@ -12066,18 +11749,18 @@ <code class="ruby"> else</code> </li> - <li class="covered" data-hits="178" data-linenumber="127"> - <span class="hits">178</span> + <li class="covered" data-hits="156" data-linenumber="127"> + <span class="hits">156</span> <code class="ruby"> true</code> </li> - <li class="covered" data-hits="256" data-linenumber="128"> - <span class="hits">256</span> + <li class="covered" data-hits="228" data-linenumber="128"> + <span class="hits">228</span> <code class="ruby"> end</code> </li> <li class="never" data-hits="" data-linenumber="129"> @@ -12099,12 +11782,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="bfaefba265a613847eb17511c91aeb33124d3b07"> + <div class="source_table" id="11328cfb263cce0e77b424d30c11127e715be20e"> <div class="header"> <h3>lib/trusty_cms/admin_ui/region_partials.rb</h3> <h4><span class="yellow">83.33 %</span> covered</h4> <div> <b>12</b> relevant lines. @@ -12126,18 +11810,18 @@ <span class="hits">1</span> <code class="ruby"> def initialize(template)</code> </li> - <li class="covered" data-hits="287" data-linenumber="3"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="3"> + <span class="hits">239</span> <code class="ruby"> @partials = Hash.new {|h,k| h[k] = &quot;&lt;strong&gt;`#{k}&#39; default partial not found!&lt;/strong&gt;&quot; }</code> </li> - <li class="covered" data-hits="287" data-linenumber="4"> - <span class="hits">287</span> + <li class="covered" data-hits="239" data-linenumber="4"> + <span class="hits">239</span> <code class="ruby"> @template = template</code> </li> <li class="never" data-hits="" data-linenumber="5"> @@ -12156,12 +11840,12 @@ <span class="hits">1</span> <code class="ruby"> def [](key)</code> </li> - <li class="covered" data-hits="230" data-linenumber="8"> - <span class="hits">230</span> + <li class="covered" data-hits="191" data-linenumber="8"> + <span class="hits">191</span> <code class="ruby"> @partials[key.to_s]</code> </li> <li class="never" data-hits="" data-linenumber="9"> @@ -12180,12 +11864,12 @@ <span class="hits">1</span> <code class="ruby"> def method_missing(method, *args, &amp;block)</code> </li> - <li class="covered" data-hits="231" data-linenumber="12"> - <span class="hits">231</span> + <li class="covered" data-hits="192" data-linenumber="12"> + <span class="hits">192</span> <code class="ruby"> if block_given?</code> </li> <li class="never" data-hits="" data-linenumber="13"> @@ -12198,12 +11882,12 @@ <code class="ruby"> # lambdas are as strict as methods in 1.9.x, making sure that the args match, Procs are not.</code> </li> - <li class="covered" data-hits="231" data-linenumber="15"> - <span class="hits">231</span> + <li class="covered" data-hits="192" data-linenumber="15"> + <span class="hits">192</span> <code class="ruby"> if RUBY_VERSION =~ /^1\.9/ and block.lambda? and block.arity != 1</code> </li> <li class="missed" data-hits="0" data-linenumber="16"> @@ -12216,12 +11900,12 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="231" data-linenumber="18"> - <span class="hits">231</span> + <li class="covered" data-hits="192" data-linenumber="18"> + <span class="hits">192</span> <code class="ruby"> @partials[method.to_s] = @template.capture(&amp;block)</code> </li> <li class="never" data-hits="" data-linenumber="19"> @@ -12255,12 +11939,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="62bfb9f3ee6e8ac2730bec06c3df334c59428c84"> + <div class="source_table" id="67d6fd9b574c8bb746cfbd6f1d3ec545d3671999"> <div class="header"> <h3>lib/trusty_cms/available_locales.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>10</b> relevant lines. @@ -12312,30 +11997,30 @@ <span class="hits">7</span> <code class="ruby"> TrustyCms.configuration.i18n.load_path.each do |path|</code> </li> - <li class="covered" data-hits="182" data-linenumber="8"> - <span class="hits">182</span> + <li class="covered" data-hits="196" data-linenumber="8"> + <span class="hits">196</span> <code class="ruby"> if File.exists?(path) &amp;&amp; path !~ /_available_tags/</code> </li> - <li class="covered" data-hits="168" data-linenumber="9"> - <span class="hits">168</span> + <li class="covered" data-hits="182" data-linenumber="9"> + <span class="hits">182</span> <code class="ruby"> locale_yaml = YAML.load_file(path)</code> </li> - <li class="covered" data-hits="168" data-linenumber="10"> - <span class="hits">168</span> + <li class="covered" data-hits="182" data-linenumber="10"> + <span class="hits">182</span> <code class="ruby"> stem = File.basename(path, &#39;.yml&#39;)</code> </li> - <li class="covered" data-hits="168" data-linenumber="11"> - <span class="hits">168</span> + <li class="covered" data-hits="182" data-linenumber="11"> + <span class="hits">182</span> <code class="ruby"> if locale_yaml[stem] &amp;&amp; lang = locale_yaml[stem][&quot;this_file_language&quot;]</code> </li> <li class="covered" data-hits="14" data-linenumber="12"> @@ -12387,12 +12072,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="7ec5b193ca91bf0e62afdd726aa3bd77aba3eaaa"> + <div class="source_table" id="0fb2f38734135f195dc6f55c5f8f8c33b0473268"> <div class="header"> <h3>lib/trusty_cms/pagination/controller.rb</h3> <h4><span class="green">92.86 %</span> covered</h4> <div> <b>14</b> relevant lines. @@ -12450,18 +12136,18 @@ <code class="ruby"> # will_paginate controller options are not overridden by tag attribetus</code> </li> - <li class="covered" data-hits="24" data-linenumber="9"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="9"> + <span class="hits">21</span> <code class="ruby"> WillPaginate::ViewHelpers.pagination_options[:param_name] = TrustyCms::Config[&quot;pagination.param_name&quot;].to_sym unless TrustyCms::Config[&quot;pagination.param_name&quot;].blank?</code> </li> - <li class="covered" data-hits="24" data-linenumber="10"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="10"> + <span class="hits">21</span> <code class="ruby"> WillPaginate::ViewHelpers.pagination_options[:per_page_param_name] = TrustyCms::Config[&quot;pagination.per_page_param_name&quot;].blank? ? :per_page : TrustyCms::Config[&quot;pagination.per_page_param_name&quot;].to_sym</code> </li> <li class="never" data-hits="" data-linenumber="11"> @@ -12474,18 +12160,18 @@ <code class="ruby"> # will_paginate view options can be overridden by tag attributes</code> </li> - <li class="covered" data-hits="24" data-linenumber="13"> - <span class="hits">24</span> + <li class="covered" data-hits="21" data-linenumber="13"> + <span class="hits">21</span> <code class="ruby"> [:class, :previous_label, :next_label, :inner_window, :outer_window, :separator, :container].each do |opt|</code> </li> - <li class="covered" data-hits="168" data-linenumber="14"> - <span class="hits">168</span> + <li class="covered" data-hits="147" data-linenumber="14"> + <span class="hits">147</span> <code class="ruby"> WillPaginate::ViewHelpers.pagination_options[opt] = TrustyCms::Config[&quot;pagination.#{opt}&quot;] unless TrustyCms::Config[&quot;pagination.#{opt}&quot;].blank?</code> </li> <li class="never" data-hits="" data-linenumber="15"> @@ -12567,11 +12253,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="28"> <span class="hits">1</span> - <code class="ruby"> before_filter :configure_pagination</code> + <code class="ruby"> before_action :configure_pagination</code> </li> <li class="never" data-hits="" data-linenumber="29"> @@ -12651,12 +12337,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="bed13f447cc3293c2e33013bd302547d11b4f7be"> + <div class="source_table" id="a2cfabfa5bf3002a51933c8f57119adc7d3d50d3"> <div class="header"> <h3>lib/trusty_cms/resource_responses.rb</h3> <h4><span class="red">80.0 %</span> covered</h4> <div> <b>70</b> relevant lines. @@ -12762,36 +12449,36 @@ <span class="hits">1</span> <code class="ruby"> def response_for(action)</code> </li> - <li class="covered" data-hits="47" data-linenumber="17"> - <span class="hits">47</span> + <li class="covered" data-hits="39" data-linenumber="17"> + <span class="hits">39</span> <code class="ruby"> responses = self.class.responses.send(action)</code> </li> - <li class="covered" data-hits="47" data-linenumber="18"> - <span class="hits">47</span> + <li class="covered" data-hits="39" data-linenumber="18"> + <span class="hits">39</span> <code class="ruby"> respond_to do |wants|</code> </li> - <li class="covered" data-hits="47" data-linenumber="19"> - <span class="hits">47</span> + <li class="covered" data-hits="39" data-linenumber="19"> + <span class="hits">39</span> <code class="ruby"> responses.each_format do |f, format_block|</code> </li> - <li class="covered" data-hits="33" data-linenumber="20"> - <span class="hits">33</span> + <li class="covered" data-hits="29" data-linenumber="20"> + <span class="hits">29</span> <code class="ruby"> if format_block</code> </li> - <li class="covered" data-hits="33" data-linenumber="21"> - <span class="hits">33</span> + <li class="covered" data-hits="29" data-linenumber="21"> + <span class="hits">29</span> <code class="ruby"> wants.send(f, &amp;wrap(format_block))</code> </li> <li class="never" data-hits="" data-linenumber="22"> @@ -12816,48 +12503,48 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="47" data-linenumber="26"> - <span class="hits">47</span> + <li class="covered" data-hits="39" data-linenumber="26"> + <span class="hits">39</span> <code class="ruby"> responses.each_published do |pub, pub_block|</code> </li> - <li class="covered" data-hits="86" data-linenumber="27"> - <span class="hits">86</span> + <li class="covered" data-hits="74" data-linenumber="27"> + <span class="hits">74</span> <code class="ruby"> wants.send(pub, &amp;wrap(pub_block))</code> </li> <li class="never" data-hits="" data-linenumber="28"> <code class="ruby"> end</code> </li> - <li class="covered" data-hits="47" data-linenumber="29"> - <span class="hits">47</span> + <li class="covered" data-hits="39" data-linenumber="29"> + <span class="hits">39</span> <code class="ruby"> if responses.default</code> </li> - <li class="covered" data-hits="10" data-linenumber="30"> - <span class="hits">10</span> + <li class="covered" data-hits="8" data-linenumber="30"> + <span class="hits">8</span> <code class="ruby"> wants.any(&amp;wrap(responses.default))</code> </li> <li class="never" data-hits="" data-linenumber="31"> <code class="ruby"> else</code> </li> - <li class="covered" data-hits="37" data-linenumber="32"> - <span class="hits">37</span> + <li class="covered" data-hits="31" data-linenumber="32"> + <span class="hits">31</span> <code class="ruby"> wants.any</code> </li> <li class="never" data-hits="" data-linenumber="33"> @@ -12894,12 +12581,12 @@ <code class="ruby"> # Makes sure our response blocks get evaluated in the right context</code> </li> - <li class="covered" data-hits="129" data-linenumber="39"> - <span class="hits">129</span> + <li class="covered" data-hits="111" data-linenumber="39"> + <span class="hits">111</span> <code class="ruby"> lambda do</code> </li> <li class="never" data-hits="" data-linenumber="40"> @@ -12912,12 +12599,12 @@ <code class="ruby"> # lambdas are as strict as methods in 1.9.x, making sure that the args match, Procs are not.</code> </li> - <li class="covered" data-hits="10" data-linenumber="42"> - <span class="hits">10</span> + <li class="covered" data-hits="8" data-linenumber="42"> + <span class="hits">8</span> <code class="ruby"> if RUBY_VERSION =~ /^1\.9/ and proc.lambda? and proc.arity != 1</code> </li> <li class="missed" data-hits="0" data-linenumber="43"> @@ -12936,12 +12623,12 @@ <code class="ruby"></code> </li> - <li class="covered" data-hits="10" data-linenumber="46"> - <span class="hits">10</span> + <li class="covered" data-hits="8" data-linenumber="46"> + <span class="hits">8</span> <code class="ruby"> instance_eval(&amp;proc)</code> </li> <li class="never" data-hits="" data-linenumber="47"> @@ -13152,12 +12839,12 @@ <span class="hits">1</span> <code class="ruby"> def default(&amp;block)</code> </li> - <li class="covered" data-hits="64" data-linenumber="82"> - <span class="hits">64</span> + <li class="covered" data-hits="54" data-linenumber="82"> + <span class="hits">54</span> <code class="ruby"> if block_given?</code> </li> <li class="covered" data-hits="7" data-linenumber="83"> @@ -13170,12 +12857,12 @@ <code class="ruby"> end</code> </li> - <li class="covered" data-hits="64" data-linenumber="85"> - <span class="hits">64</span> + <li class="covered" data-hits="54" data-linenumber="85"> + <span class="hits">54</span> <code class="ruby"> @default</code> </li> <li class="never" data-hits="" data-linenumber="86"> @@ -13248,18 +12935,18 @@ <span class="hits">1</span> <code class="ruby"> def each_published</code> </li> - <li class="covered" data-hits="47" data-linenumber="98"> - <span class="hits">47</span> + <li class="covered" data-hits="39" data-linenumber="98"> + <span class="hits">39</span> <code class="ruby"> publish_formats.each do |format|</code> </li> - <li class="covered" data-hits="86" data-linenumber="99"> - <span class="hits">86</span> + <li class="covered" data-hits="74" data-linenumber="99"> + <span class="hits">74</span> <code class="ruby"> yield format, publish_block if block_given?</code> </li> <li class="never" data-hits="" data-linenumber="100"> @@ -13284,18 +12971,18 @@ <span class="hits">1</span> <code class="ruby"> def each_format</code> </li> - <li class="covered" data-hits="47" data-linenumber="104"> - <span class="hits">47</span> + <li class="covered" data-hits="39" data-linenumber="104"> + <span class="hits">39</span> <code class="ruby"> @block_order.each do |format|</code> </li> - <li class="covered" data-hits="33" data-linenumber="105"> - <span class="hits">33</span> + <li class="covered" data-hits="29" data-linenumber="105"> + <span class="hits">29</span> <code class="ruby"> yield format, @blocks[format] if block_given?</code> </li> <li class="never" data-hits="" data-linenumber="106"> @@ -13395,12 +13082,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="caa7ec0029d51eb5c9bde0f679fcfcb448b3cd01"> + <div class="source_table" id="ad28fc13353a228211160292c64c178f99d727f2"> <div class="header"> <h3>spec/controllers/application_controller_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>40</b> relevant lines. @@ -13701,11 +13389,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="49"> <span class="hits">1</span> - <code class="ruby"> TrustyCms::Config[&#39;local.timezone&#39;] = &#39;Kuala Lumpur&#39;</code> + <code class="ruby"> TrustyCms::Config[&#39;local.timezone&#39;] = &#39;UTC&#39;</code> </li> <li class="covered" data-hits="1" data-linenumber="50"> <span class="hits">1</span> @@ -13713,11 +13401,11 @@ </li> <li class="covered" data-hits="1" data-linenumber="51"> <span class="hits">1</span> - <code class="ruby"> expect(Time.zone.name).to eq(&#39;Kuala Lumpur&#39;)</code> + <code class="ruby"> expect(Time.zone.name).to eq(&#39;UTC&#39;)</code> </li> <li class="never" data-hits="" data-linenumber="52"> @@ -13773,12 +13461,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="337cbe163bc8bfdb5179ca7658af10ab02e6c229"> + <div class="source_table" id="ac954dc35f7a221e8e355b693dff48716a41c94f"> <div class="header"> <h3>spec/controllers/users_controller_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>3</b> relevant lines. @@ -13827,12 +13516,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="a27fd50274e4ef14baece85f6fc1ef2dff24481e"> + <div class="source_table" id="3cc0a60749736c01618a4dac4a949ad19f971ebf"> <div class="header"> <h3>spec/controllers/welcome_controller_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>3</b> relevant lines. @@ -13881,12 +13571,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="b8f4cd120e1d67bc8beac165fcf0bc0aa4481001"> + <div class="source_table" id="2e372ce9efba322966a99a44ae3037847b4b7262"> <div class="header"> <h3>spec/factories/layout.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>4</b> relevant lines. @@ -14001,12 +13692,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="52c1bc36f76c25cd101e46c7a3f7a84525c34f4b"> + <div class="source_table" id="13f9da5e4654a837d7a7fa4bf4dfe846817dcbe8"> <div class="header"> <h3>spec/factories/page.rb</h3> <h4><span class="green">94.12 %</span> covered</h4> <div> <b>34</b> relevant lines. @@ -14397,12 +14089,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="a6d1c85998b8276583505169d707d367cc646d80"> + <div class="source_table" id="43c889995f5a88d85b177672c6b7258a36da847d"> <div class="header"> <h3>spec/factories/page_part.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>4</b> relevant lines. @@ -14463,12 +14156,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="859825ade596f74e620e85f509164a957b8443d5"> + <div class="source_table" id="bb53b254f55492b65c9488519a4a084dbbbdcae2"> <div class="header"> <h3>spec/factories/user.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>25</b> relevant lines. @@ -14691,12 +14385,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="5d70a4be91101af4532a395a46c8d595d80b8fb0"> + <div class="source_table" id="6b795fc960ee17e8313e6ee8aacb5edd5dc7a92b"> <div class="header"> <h3>spec/features/admin_login_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>52</b> relevant lines. @@ -15261,12 +14956,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="a413cd7cc1724408d7a525553d4834265f04885e"> + <div class="source_table" id="7add22ef7d3b00bd38c2c13423da3140645cd781"> <div class="header"> <h3>spec/features/config_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>21</b> relevant lines. @@ -15483,385 +15179,14 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="ab78dbd6e5a827bfa8db3f97d98882ca4edbba01"> + <div class="source_table" id="c35ea2aae277770e5b88ca23c8d45289ba333a8a"> <div class="header"> - <h3>spec/features/javascript_smoke_spec.rb</h3> - <h4><span class="green">100.0 %</span> covered</h4> - <div> - <b>30</b> relevant lines. - <span class="green"><b>30</b> lines covered</span> and - <span class="red"><b>0</b> lines missed.</span> - </div> - </div> - - <pre> - <ol> - - <li class="covered" data-hits="1" data-linenumber="1"> - <span class="hits">1</span> - - <code class="ruby">require &#39;rails_helper&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="2"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="3"> - <span class="hits">1</span> - - <code class="ruby">describe &#39;Editing using javascript features&#39;, js: true do</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="4"> - <span class="hits">1</span> - - <code class="ruby"> fixtures :users</code> - </li> - - <li class="never" data-hits="" data-linenumber="5"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="6"> - <span class="hits">1</span> - - <code class="ruby"> before(:each) do</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="7"> - <span class="hits">1</span> - - <code class="ruby"> @admin = users(:captain_janeway)</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="8"> - <span class="hits">1</span> - - <code class="ruby"> log_in_as @admin.login</code> - </li> - - <li class="never" data-hits="" data-linenumber="9"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="10"> - - - <code class="ruby"></code> - </li> - - <li class="covered" data-hits="1" data-linenumber="11"> - <span class="hits">1</span> - - <code class="ruby"> it &#39;edits all sorts of content&#39; do</code> - </li> - - <li class="never" data-hits="" data-linenumber="12"> - - - <code class="ruby"> # Create a new homepage</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="13"> - <span class="hits">1</span> - - <code class="ruby"> click_link &#39;New Homepage&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="14"> - <span class="hits">1</span> - - <code class="ruby"> fill_in &#39;Page Title&#39;, with: &#39;Voyager Home&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="15"> - <span class="hits">1</span> - - <code class="ruby"> click_button &#39;Create Page&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="16"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="17"> - - - <code class="ruby"> # Create a new child page of the home page</code> - </li> - - <li class="never" data-hits="" data-linenumber="18"> - - - <code class="ruby"> # This is failing on Travis, but not on my box. Just trying to edit to push a new version.</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="19"> - <span class="hits">1</span> - - <code class="ruby"> click_link &#39;Add Child&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="20"> - <span class="hits">1</span> - - <code class="ruby"> click_link &#39;Normal Page&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="21"> - <span class="hits">1</span> - - <code class="ruby"> fill_in &#39;Page Title&#39;, with: &#39;Command Center&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="22"> - <span class="hits">1</span> - - <code class="ruby"> page.execute_script(&quot;CKEDITOR.instances[&#39;part_body_content&#39;].setData(&#39;You are on the bridge.&#39;);&quot;)</code> - </li> - - <li class="never" data-hits="" data-linenumber="23"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="24"> - - - <code class="ruby"> # Add a custom page part</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="25"> - <span class="hits">1</span> - - <code class="ruby"> click_link &#39;Add Part&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="26"> - <span class="hits">1</span> - - <code class="ruby"> fill_in &#39;Name&#39;, with: &#39;footer&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="27"> - <span class="hits">1</span> - - <code class="ruby"> click_button &#39;Add Part&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="28"> - <span class="hits">1</span> - - <code class="ruby"> expect(page).to have_selector &#39;#tabs #tab_footer&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="29"> - <span class="hits">1</span> - - <code class="ruby"> page.execute_script(&quot;CKEDITOR.instances[&#39;part_footer_content&#39;].setData(&#39;You are on the bridge.&#39;);&quot;)</code> - </li> - - <li class="never" data-hits="" data-linenumber="30"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="31"> - - - <code class="ruby"> # Switch tabs</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="32"> - <span class="hits">1</span> - - <code class="ruby"> click_link &#39;tab_body&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="33"> - <span class="hits">1</span> - - <code class="ruby"> result = evaluate_script(&quot;CKEDITOR.instances[&#39;part_body_content&#39;].getData()&quot;)</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="34"> - <span class="hits">1</span> - - <code class="ruby"> puts result</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="35"> - <span class="hits">1</span> - - <code class="ruby"> result.should include(&quot;You are on the bridge.&quot;)</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="36"> - <span class="hits">1</span> - - <code class="ruby"> expect(page).to_not have_field &#39;part_footer_content&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="37"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="38"> - - - <code class="ruby"> # Remove a tab</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="39"> - <span class="hits">1</span> - - <code class="ruby"> find(&#39;#tab_extended .close&#39;).click</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="40"> - <span class="hits">1</span> - - <code class="ruby"> expect(page).to_not have_content &#39;extended&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="41"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="42"> - - - <code class="ruby"> # Preview</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="43"> - <span class="hits">1</span> - - <code class="ruby"> click_button &#39;Preview&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="44"> - <span class="hits">1</span> - - <code class="ruby"> within_frame &#39;page-preview&#39; do</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="45"> - <span class="hits">1</span> - - <code class="ruby"> expect(page).to have_content &#39;You are on the bridge.&#39;</code> - </li> - - <li class="covered" data-hits="1" data-linenumber="46"> - <span class="hits">1</span> - - <code class="ruby"> expect(page).to_not have_content &#39;New Page&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="47"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="48"> - - - <code class="ruby"></code> - </li> - - <li class="never" data-hits="" data-linenumber="49"> - - - <code class="ruby"> # TODO: This is currently broken by treetable, but I don&#39;t understand how it works well enough to fix. Will consult carols10cents.</code> - </li> - - <li class="never" data-hits="" data-linenumber="50"> - - - <code class="ruby"> # Save and check that all changes were saved</code> - </li> - - <li class="never" data-hits="" data-linenumber="51"> - - - <code class="ruby"> #click_button &#39;Save Changes&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="52"> - - - <code class="ruby"> #click_link &#39;Command Center&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="53"> - - - <code class="ruby"> #expect(page).to_not have_content &#39;extended&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="54"> - - - <code class="ruby"> #expect(page).to have_content &#39;footer&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="55"> - - - <code class="ruby"> #expect(page).to have_field &#39;part_body_content&#39;, with: &#39;You are on the bridge.&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="56"> - - - <code class="ruby"> #click_link &#39;tab_footer&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="57"> - - - <code class="ruby"> #expect(page).to have_field &#39;part_footer_content&#39;, with: &#39;Copyright Voyager 2371&#39;</code> - </li> - - <li class="never" data-hits="" data-linenumber="58"> - - - <code class="ruby"> end</code> - </li> - - <li class="never" data-hits="" data-linenumber="59"> - - - <code class="ruby">end</code> - </li> - - </ol> - </pre> -</div> - - <div class="source_table" id="7570781db4c3155e965463b658470da596800bab"> - <div class="header"> <h3>spec/features/layouts_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>33</b> relevant lines. <span class="green"><b>33</b> lines covered</span> and @@ -16167,19 +15492,20 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="d4d1a930f2f47b0ce0846efa1c917ebdf0bf2c69"> + <div class="source_table" id="00a8a76a40cbc43916d2f53c3e4536194342e0d1"> <div class="header"> <h3>spec/features/pages_spec.rb</h3> - <h4><span class="green">100.0 %</span> covered</h4> + <h4><span class="green">94.12 %</span> covered</h4> <div> <b>34</b> relevant lines. - <span class="green"><b>34</b> lines covered</span> and - <span class="red"><b>0</b> lines missed.</span> + <span class="green"><b>32</b> lines covered</span> and + <span class="red"><b>2</b> lines missed.</span> </div> </div> <pre> <ol> @@ -16383,17 +15709,17 @@ </li> <li class="never" data-hits="" data-linenumber="34"> - <code class="ruby"> </code> + <code class="ruby"></code> </li> <li class="never" data-hits="" data-linenumber="35"> - <code class="ruby"> </code> + <code class="ruby"></code> </li> <li class="covered" data-hits="1" data-linenumber="36"> <span class="hits">1</span> @@ -16482,19 +15808,19 @@ <code class="ruby"></code> </li> - <li class="covered" data-hits="1" data-linenumber="51"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="51"> + <code class="ruby"> expect(page).to have_content &#39;No Pages&#39;</code> </li> - <li class="covered" data-hits="1" data-linenumber="52"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="52"> + <code class="ruby"> expect(page).to have_link &#39;New Homepage&#39;</code> </li> <li class="never" data-hits="" data-linenumber="53"> @@ -16515,12 +15841,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="f651b1e0d6b03b639bb1910679349dcb5c4906d8"> + <div class="source_table" id="26d35c1978083211ae85513115d98df410ca5244"> <div class="header"> <h3>spec/models/layout_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>19</b> relevant lines. @@ -16707,19 +16034,20 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="5e6e398d1f9a901307ea91dab9ee535aa8c9a444"> + <div class="source_table" id="a251c7546c3386878c1808f13620f76a33137872"> <div class="header"> <h3>spec/rails_helper.rb</h3> - <h4><span class="green">100.0 %</span> covered</h4> + <h4><span class="green">95.83 %</span> covered</h4> <div> <b>24</b> relevant lines. - <span class="green"><b>24</b> lines covered</span> and - <span class="red"><b>0</b> lines missed.</span> + <span class="green"><b>23</b> lines covered</span> and + <span class="red"><b>1</b> lines missed.</span> </div> </div> <pre> <ol> @@ -16776,13 +16104,13 @@ <span class="hits">1</span> <code class="ruby">Capybara.register_driver :poltergeist do |app|</code> </li> - <li class="covered" data-hits="1" data-linenumber="10"> - <span class="hits">1</span> + <li class="missed" data-hits="0" data-linenumber="10"> + <code class="ruby"> Capybara::Poltergeist::Driver.new(app, timeout: 60)</code> </li> <li class="never" data-hits="" data-linenumber="11"> @@ -17142,12 +16470,12 @@ <span class="hits">1</span> <code class="ruby"> config.after(:each) do</code> </li> - <li class="covered" data-hits="28" data-linenumber="71"> - <span class="hits">28</span> + <li class="covered" data-hits="39" data-linenumber="71"> + <span class="hits">39</span> <code class="ruby"> DatabaseCleaner.clean</code> </li> <li class="never" data-hits="" data-linenumber="72"> @@ -17163,12 +16491,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="e26ef2de8407666da2a4b16334e43c210a4e8735"> + <div class="source_table" id="2faf97185635284b364ffa6cdbc7f168db049fdb"> <div class="header"> <h3>spec/routing/welcome_routing_spec.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>8</b> relevant lines. @@ -17289,12 +16618,13 @@ </li> </ol> </pre> </div> + - <div class="source_table" id="992b2e5d02f76777327edeb5263d89e2cab32d72"> + <div class="source_table" id="e8c568b143982375ae5eef071184d4fa41bfa61f"> <div class="header"> <h3>spec/support/custom_actions.rb</h3> <h4><span class="green">100.0 %</span> covered</h4> <div> <b>5</b> relevant lines. @@ -17328,30 +16658,30 @@ <span class="hits">1</span> <code class="ruby">def log_in_as(login, plaintext_password = &#39;password&#39;)</code> </li> - <li class="covered" data-hits="21" data-linenumber="5"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="5"> + <span class="hits">20</span> <code class="ruby"> visit &#39;/&#39;</code> </li> - <li class="covered" data-hits="21" data-linenumber="6"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="6"> + <span class="hits">20</span> <code class="ruby"> fill_in &#39;username_or_email&#39;, with: login</code> </li> - <li class="covered" data-hits="21" data-linenumber="7"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="7"> + <span class="hits">20</span> <code class="ruby"> fill_in &#39;password&#39;, with: plaintext_password</code> </li> - <li class="covered" data-hits="21" data-linenumber="8"> - <span class="hits">21</span> + <li class="covered" data-hits="20" data-linenumber="8"> + <span class="hits">20</span> <code class="ruby"> click_on &#39;Login&#39;</code> </li> <li class="never" data-hits="" data-linenumber="9"> @@ -17367,9 +16697,10 @@ </li> </ol> </pre> </div> + </div> </div> </body> </html>