coverage/index.html in contentful-2.9.1 vs coverage/index.html in contentful-2.9.2
- old
+ new
@@ -3,40 +3,40 @@
<head>
<title>Code coverage for Delivery.rb</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src='./assets/0.10.2/application.js' type='text/javascript'></script>
<link href='./assets/0.10.2/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
- <link rel="shortcut icon" type="image/png" href="./assets/0.10.2/favicon_green.png" />
+ <link rel="shortcut icon" type="image/png" href="./assets/0.10.2/favicon_yellow.png" />
<link rel="icon" type="image/png" href="./assets/0.10.2/favicon.png" />
</head>
<body>
<div id="loading">
<img src="./assets/0.10.2/loading.gif" alt="loading"/>
</div>
<div id="wrapper" style="display:none;">
- <div class="timestamp">Generated <abbr class="timeago" title="2018-08-24T10:47:49-04:00">2018-08-24T10:47:49-04:00</abbr></div>
+ <div class="timestamp">Generated <abbr class="timeago" title="2018-09-12T13:32:20+02:00">2018-09-12T13:32:20+02: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="green">98.92%</span></span>
+ (<span class="covered_percent"><span class="yellow">82.67%</span></span>
covered at
<span class="covered_strength">
<span class="green">
- 485.42
+ 303.89
</span>
</span> hits/line)
</h2>
<a name="AllFiles"></a>
<div>
- <b>51</b> files in total.
- <b>2128</b> relevant lines.
- <span class="green"><b>2105</b> lines covered</span> and
- <span class="red"><b>23</b> lines missed </span>
+ <b>30</b> files in total.
+ <b>952</b> relevant lines.
+ <span class="green"><b>787</b> lines covered</span> and
+ <span class="red"><b>165</b> lines missed </span>
</div>
<table class="file_list">
<thead>
<tr>
<th>File</th>
@@ -60,86 +60,86 @@
<td>1.0</td>
</tr>
<tr>
<td class="strong"><a href="#1c9cd9f08977d8378a5d40be4bcddd0f07adc70d" class="src_link" title="lib/contentful/array.rb">lib/contentful/array.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="red strong">52.94 %</td>
<td>76</td>
<td>34</td>
- <td>34</td>
- <td>0</td>
- <td>19.6</td>
+ <td>18</td>
+ <td>16</td>
+ <td>10.2</td>
</tr>
<tr>
<td class="strong"><a href="#bc50260d115630bb3b54a3ab26a820be409e35fe" class="src_link" title="lib/contentful/array_like.rb">lib/contentful/array_like.rb</a></td>
- <td class="yellow strong">82.35 %</td>
+ <td class="red strong">76.47 %</td>
<td>51</td>
<td>17</td>
- <td>14</td>
- <td>3</td>
- <td>7.1</td>
+ <td>13</td>
+ <td>4</td>
+ <td>4.2</td>
</tr>
<tr>
<td class="strong"><a href="#167545c06de91266c75254299e80bf4aa23830c5" class="src_link" title="lib/contentful/asset.rb">lib/contentful/asset.rb</a></td>
- <td class="green strong">95.0 %</td>
+ <td class="green strong">92.5 %</td>
<td>103</td>
<td>40</td>
- <td>38</td>
- <td>2</td>
- <td>438.2</td>
+ <td>37</td>
+ <td>3</td>
+ <td>138.9</td>
</tr>
<tr>
<td class="strong"><a href="#c9e25d4e0351ac49d13d793c5d0d6e10c428977b" class="src_link" title="lib/contentful/base_resource.rb">lib/contentful/base_resource.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="yellow strong">88.0 %</td>
<td>94</td>
<td>50</td>
- <td>50</td>
- <td>0</td>
- <td>5910.8</td>
+ <td>44</td>
+ <td>6</td>
+ <td>2032.2</td>
</tr>
<tr>
<td class="strong"><a href="#b0e31f234acd83c871a193ce29ed6b38e9adc98e" class="src_link" title="lib/contentful/client.rb">lib/contentful/client.rb</a></td>
- <td class="green strong">96.69 %</td>
+ <td class="yellow strong">82.12 %</td>
<td>434</td>
<td>151</td>
- <td>146</td>
- <td>5</td>
- <td>120.9</td>
+ <td>124</td>
+ <td>27</td>
+ <td>29.6</td>
</tr>
<tr>
<td class="strong"><a href="#beb22ab5c60eaaa44a2cba4f526b8a2630d7a31a" class="src_link" title="lib/contentful/coercions.rb">lib/contentful/coercions.rb</a></td>
- <td class="green strong">94.03 %</td>
- <td>163</td>
- <td>67</td>
- <td>63</td>
- <td>4</td>
- <td>366.3</td>
+ <td class="green strong">92.86 %</td>
+ <td>168</td>
+ <td>70</td>
+ <td>65</td>
+ <td>5</td>
+ <td>16.4</td>
</tr>
<tr>
<td class="strong"><a href="#14469a10a1dbe8c3a1825151ed33eb9240571afb" class="src_link" title="lib/contentful/content_type.rb">lib/contentful/content_type.rb</a></td>
<td class="green strong">94.44 %</td>
<td>33</td>
<td>18</td>
<td>17</td>
<td>1</td>
- <td>1401.6</td>
+ <td>19.6</td>
</tr>
<tr>
<td class="strong"><a href="#a46b40f2e6381b7f2ac84d26e7bc008d4e6985eb" class="src_link" title="lib/contentful/content_type_cache.rb">lib/contentful/content_type_cache.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="green strong">91.67 %</td>
<td>26</td>
<td>12</td>
- <td>12</td>
- <td>0</td>
- <td>698.3</td>
+ <td>11</td>
+ <td>1</td>
+ <td>229.4</td>
</tr>
<tr>
<td class="strong"><a href="#1dea44e36966a52d67e8c4ee9f13f956e974f16f" class="src_link" title="lib/contentful/deleted_asset.rb">lib/contentful/deleted_asset.rb</a></td>
<td class="green strong">100.0 %</td>
@@ -160,408 +160,198 @@
<td>1.0</td>
</tr>
<tr>
<td class="strong"><a href="#97df464094b50c0508a4a014acd1a9beace447a1" class="src_link" title="lib/contentful/entry.rb">lib/contentful/entry.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="green strong">95.45 %</td>
<td>99</td>
<td>44</td>
- <td>44</td>
- <td>0</td>
- <td>1848.7</td>
+ <td>42</td>
+ <td>2</td>
+ <td>546.5</td>
</tr>
<tr>
<td class="strong"><a href="#98433a4cac96676bcf6b420f480c3d946ae0d0cb" class="src_link" title="lib/contentful/error.rb">lib/contentful/error.rb</a></td>
- <td class="green strong">98.92 %</td>
+ <td class="red strong">68.82 %</td>
<td>204</td>
<td>93</td>
- <td>92</td>
- <td>1</td>
- <td>13.6</td>
+ <td>64</td>
+ <td>29</td>
+ <td>0.7</td>
</tr>
<tr>
<td class="strong"><a href="#4f89ce6a6221e537edb751b920a159e36a286ebd" class="src_link" title="lib/contentful/field.rb">lib/contentful/field.rb</a></td>
<td class="green strong">100.0 %</td>
<td>47</td>
<td>21</td>
<td>21</td>
<td>0</td>
- <td>1537.3</td>
+ <td>40.2</td>
</tr>
<tr>
<td class="strong"><a href="#eecf0f806597fc4b233727ac4e855ef0a80b0ade" class="src_link" title="lib/contentful/fields_resource.rb">lib/contentful/fields_resource.rb</a></td>
<td class="green strong">100.0 %</td>
<td>138</td>
<td>65</td>
<td>65</td>
<td>0</td>
- <td>1670.1</td>
+ <td>540.3</td>
</tr>
<tr>
<td class="strong"><a href="#5ed9fab05507df717ba26956cbb2b69097c50f41" class="src_link" title="lib/contentful/file.rb">lib/contentful/file.rb</a></td>
<td class="green strong">100.0 %</td>
<td>20</td>
<td>10</td>
<td>10</td>
<td>0</td>
- <td>1053.1</td>
+ <td>346.9</td>
</tr>
<tr>
<td class="strong"><a href="#f0b3585d50697809ca059b22b439d1c92b144124" class="src_link" title="lib/contentful/link.rb">lib/contentful/link.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="red strong">66.67 %</td>
<td>17</td>
<td>6</td>
- <td>6</td>
- <td>0</td>
- <td>1.3</td>
+ <td>4</td>
+ <td>2</td>
+ <td>0.7</td>
</tr>
<tr>
<td class="strong"><a href="#ce8ecf27b5e97b41247b7386680ee9aa0e670574" class="src_link" title="lib/contentful/locale.rb">lib/contentful/locale.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="red strong">55.56 %</td>
<td>16</td>
<td>9</td>
- <td>9</td>
- <td>0</td>
- <td>9.9</td>
+ <td>5</td>
+ <td>4</td>
+ <td>0.6</td>
</tr>
<tr>
<td class="strong"><a href="#0b0fac99f5d491e120b04db5fad4d156a78fc99e" class="src_link" title="lib/contentful/location.rb">lib/contentful/location.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="red strong">75.0 %</td>
<td>14</td>
<td>8</td>
- <td>8</td>
- <td>0</td>
- <td>1.3</td>
+ <td>6</td>
+ <td>2</td>
+ <td>0.8</td>
</tr>
<tr>
<td class="strong"><a href="#283a9b245e7a50ed1ed0ff2acf5bf3df054a6b05" class="src_link" title="lib/contentful/request.rb">lib/contentful/request.rb</a></td>
- <td class="green strong">96.0 %</td>
+ <td class="yellow strong">88.0 %</td>
<td>56</td>
<td>25</td>
- <td>24</td>
- <td>1</td>
- <td>97.8</td>
+ <td>22</td>
+ <td>3</td>
+ <td>29.4</td>
</tr>
<tr>
<td class="strong"><a href="#ea1894a682921dc1a4b4d4255935538a0067cdfd" class="src_link" title="lib/contentful/resource_builder.rb">lib/contentful/resource_builder.rb</a></td>
- <td class="green strong">96.74 %</td>
+ <td class="green strong">94.57 %</td>
<td>166</td>
<td>92</td>
- <td>89</td>
- <td>3</td>
- <td>1404.2</td>
+ <td>87</td>
+ <td>5</td>
+ <td>484.2</td>
</tr>
<tr>
<td class="strong"><a href="#e5da896cf0ec7b470de392efaedd4669444f03b9" class="src_link" title="lib/contentful/resource_references.rb">lib/contentful/resource_references.rb</a></td>
<td class="green strong">100.0 %</td>
<td>18</td>
<td>6</td>
<td>6</td>
<td>0</td>
- <td>2.0</td>
+ <td>1.5</td>
</tr>
<tr>
<td class="strong"><a href="#a54a8ab8e00230a5d92a5eb8a7e43f264a700db2" class="src_link" title="lib/contentful/response.rb">lib/contentful/response.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="red strong">80.0 %</td>
<td>107</td>
<td>55</td>
- <td>55</td>
- <td>0</td>
- <td>62.3</td>
+ <td>44</td>
+ <td>11</td>
+ <td>13.9</td>
</tr>
<tr>
<td class="strong"><a href="#42827798fb56cb87d145e81d9ae46dfe97e9818b" class="src_link" title="lib/contentful/space.rb">lib/contentful/space.rb</a></td>
- <td class="yellow strong">83.33 %</td>
+ <td class="red strong">58.33 %</td>
<td>24</td>
<td>12</td>
- <td>10</td>
- <td>2</td>
- <td>4.3</td>
+ <td>7</td>
+ <td>5</td>
+ <td>0.6</td>
</tr>
<tr>
<td class="strong"><a href="#a300a2b740de48d4aa41783c879260ce3e4785ba" class="src_link" title="lib/contentful/support.rb">lib/contentful/support.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="green strong">96.0 %</td>
<td>85</td>
<td>25</td>
- <td>25</td>
- <td>0</td>
- <td>10798.9</td>
+ <td>24</td>
+ <td>1</td>
+ <td>2529.3</td>
</tr>
<tr>
<td class="strong"><a href="#84dd5a82215a9c45df06f943a5b88003a007c2e3" class="src_link" title="lib/contentful/sync.rb">lib/contentful/sync.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="red strong">44.74 %</td>
<td>85</td>
<td>38</td>
- <td>38</td>
- <td>0</td>
- <td>15.4</td>
+ <td>17</td>
+ <td>21</td>
+ <td>0.4</td>
</tr>
<tr>
<td class="strong"><a href="#99e7ff3ec5cef4c1f8a70725a19da05567b157fd" class="src_link" title="lib/contentful/sync_page.rb">lib/contentful/sync_page.rb</a></td>
- <td class="green strong">94.74 %</td>
+ <td class="red strong">57.89 %</td>
<td>50</td>
<td>19</td>
- <td>18</td>
- <td>1</td>
- <td>10.6</td>
+ <td>11</td>
+ <td>8</td>
+ <td>0.6</td>
</tr>
<tr>
- <td class="strong"><a href="#26151d16243d86e4a0f5aa143518973c5fc190f5" class="src_link" title="spec/asset_spec.rb">spec/asset_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>192</td>
- <td>104</td>
- <td>104</td>
- <td>0</td>
- <td>1.4</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#f95dca85be477fbdc528fdb56a7e036b592793bf" class="src_link" title="spec/auto_includes_spec.rb">spec/auto_includes_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>12</td>
- <td>7</td>
- <td>7</td>
- <td>0</td>
- <td>1.3</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#a5b449a98635efa082944faacae851b1dab9ab8c" class="src_link" title="spec/client_class_spec.rb">spec/client_class_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>65</td>
- <td>37</td>
- <td>37</td>
- <td>0</td>
- <td>1.6</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#d051f37597cb573fb8f2516b5cdf4009ca5c4e80" class="src_link" title="spec/client_configuration_spec.rb">spec/client_configuration_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>350</td>
- <td>152</td>
- <td>152</td>
- <td>0</td>
- <td>1.2</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#a13ad32dd6d5c02d3772a4dd1d1e6e305b77003e" class="src_link" title="spec/content_type_spec.rb">spec/content_type_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>49</td>
- <td>26</td>
- <td>26</td>
- <td>0</td>
- <td>1.5</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#4c609b9f8ef04e1d39a0e44d3e7df4e970ef32ed" class="src_link" title="spec/deleted_asset_spec.rb">spec/deleted_asset_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>38</td>
- <td>20</td>
- <td>20</td>
- <td>0</td>
- <td>1.3</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#363838f9765468206e180a5461c937dff2f2ee47" class="src_link" title="spec/deleted_entry_spec.rb">spec/deleted_entry_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>38</td>
- <td>20</td>
- <td>20</td>
- <td>0</td>
- <td>1.3</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#b9d994cc83de1652f7c9126b34ef4d10041b9da0" class="src_link" title="spec/entry_spec.rb">spec/entry_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>542</td>
- <td>253</td>
- <td>253</td>
- <td>0</td>
- <td>1.3</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#ba5ec4bdbf6ab50e064edb4d1e274e870b307f6e" class="src_link" title="spec/error_class_spec.rb">spec/error_class_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>327</td>
- <td>151</td>
- <td>151</td>
- <td>0</td>
- <td>1.0</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#a882eb4cc91a2c1702f2e5743aba55a06bbc06f0" class="src_link" title="spec/error_requests_spec.rb">spec/error_requests_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>87</td>
- <td>44</td>
- <td>44</td>
- <td>0</td>
- <td>1.7</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#60501d65433b1709942162aa7e81098ef5f8d6cc" class="src_link" title="spec/field_spec.rb">spec/field_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>95</td>
- <td>52</td>
- <td>52</td>
- <td>0</td>
- <td>2.1</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#f319b7711f92cae0e531bde60aaa88fa553e06cf" class="src_link" title="spec/file_spec.rb">spec/file_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>33</td>
- <td>18</td>
- <td>18</td>
- <td>0</td>
- <td>1.4</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#0e177320f9d9f1f1848788e038064e0e57e552dd" class="src_link" title="spec/link_spec.rb">spec/link_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>50</td>
- <td>28</td>
- <td>28</td>
- <td>0</td>
- <td>1.7</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#3087380aad15023264d655b41cb4b039f41d8e4d" class="src_link" title="spec/locale_spec.rb">spec/locale_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>37</td>
- <td>18</td>
- <td>18</td>
- <td>0</td>
- <td>1.3</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#05f5b25581a35a18308ada667027abe9591adca2" class="src_link" title="spec/location_spec.rb">spec/location_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>25</td>
- <td>12</td>
- <td>12</td>
- <td>0</td>
- <td>1.2</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#95ae9505ac5703f29dc61019198d16ca813935a2" class="src_link" title="spec/request_spec.rb">spec/request_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>57</td>
- <td>31</td>
- <td>31</td>
- <td>0</td>
- <td>1.1</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#9c14f2e925ace67d177e53f0129d77745bd3f83f" class="src_link" title="spec/resource_building_spec.rb">spec/resource_building_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>31</td>
- <td>21</td>
- <td>21</td>
- <td>0</td>
- <td>1.0</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#19ee8dac79d02390e73ed93191aa8c676874060e" class="src_link" title="spec/response_spec.rb">spec/response_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>62</td>
- <td>35</td>
- <td>35</td>
- <td>0</td>
- <td>1.3</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#af3edbfb21ba19158fe1a8aee1384a7e9b406807" class="src_link" title="spec/space_spec.rb">spec/space_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>31</td>
- <td>17</td>
- <td>17</td>
- <td>0</td>
- <td>1.6</td>
- </tr>
-
- <tr>
<td class="strong"><a href="#5eb25a1b26ae65158e1a7386a20084d608b4951d" class="src_link" title="spec/support/client.rb">spec/support/client.rb</a></td>
<td class="green strong">100.0 %</td>
<td>6</td>
<td>2</td>
<td>2</td>
<td>0</td>
- <td>106.5</td>
+ <td>24.0</td>
</tr>
<tr>
<td class="strong"><a href="#a4ba320676b73b8644cffc9dbb12bbe8e19a9934" class="src_link" title="spec/support/json_responses.rb">spec/support/json_responses.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="red strong">27.27 %</td>
<td>18</td>
<td>11</td>
- <td>11</td>
- <td>0</td>
- <td>63.1</td>
+ <td>3</td>
+ <td>8</td>
+ <td>0.3</td>
</tr>
<tr>
<td class="strong"><a href="#027342a1ab3607ccd90fe9e5972948d26cbc8bed" class="src_link" title="spec/support/vcr.rb">spec/support/vcr.rb</a></td>
- <td class="green strong">100.0 %</td>
+ <td class="yellow strong">90.0 %</td>
<td>16</td>
<td>10</td>
- <td>10</td>
- <td>0</td>
- <td>21.3</td>
+ <td>9</td>
+ <td>1</td>
+ <td>5.6</td>
</tr>
- <tr>
- <td class="strong"><a href="#95b8bb4afe6ed95b076be799979ae2c639fbab8f" class="src_link" title="spec/sync_page_spec.rb">spec/sync_page_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>103</td>
- <td>54</td>
- <td>54</td>
- <td>0</td>
- <td>1.7</td>
- </tr>
-
- <tr>
- <td class="strong"><a href="#f811ceb52b7a29eaa4e3dd16037352e742150ad6" class="src_link" title="spec/sync_spec.rb">spec/sync_spec.rb</a></td>
- <td class="green strong">100.0 %</td>
- <td>180</td>
- <td>79</td>
- <td>79</td>
- <td>0</td>
- <td>1.7</td>
- </tr>
-
</tbody>
</table>
</div>
@@ -614,15 +404,15 @@
<div class="source_table" id="1c9cd9f08977d8378a5d40be4bcddd0f07adc70d">
<div class="header">
<h3>lib/contentful/array.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="red">52.94 %</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>18</b> lines covered</span> and
+ <span class="red"><b>16</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -745,48 +535,48 @@
<code class="ruby"> endpoint = '', *)</code>
</li>
- <li class="covered" data-hits="101" data-linenumber="21">
- <span class="hits">101</span>
+ <li class="covered" data-hits="56" data-linenumber="21">
+ <span class="hits">56</span>
<code class="ruby"> super(item, configuration)</code>
</li>
<li class="never" data-hits="" data-linenumber="22">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="101" data-linenumber="23">
- <span class="hits">101</span>
+ <li class="covered" data-hits="56" data-linenumber="23">
+ <span class="hits">56</span>
<code class="ruby"> @endpoint = endpoint</code>
</li>
- <li class="covered" data-hits="101" data-linenumber="24">
- <span class="hits">101</span>
+ <li class="covered" data-hits="56" data-linenumber="24">
+ <span class="hits">56</span>
<code class="ruby"> @total = item.fetch('total', nil)</code>
</li>
- <li class="covered" data-hits="101" data-linenumber="25">
- <span class="hits">101</span>
+ <li class="covered" data-hits="56" data-linenumber="25">
+ <span class="hits">56</span>
<code class="ruby"> @limit = item.fetch('limit', nil)</code>
</li>
- <li class="covered" data-hits="101" data-linenumber="26">
- <span class="hits">101</span>
+ <li class="covered" data-hits="56" data-linenumber="26">
+ <span class="hits">56</span>
<code class="ruby"> @skip = item.fetch('skip', nil)</code>
</li>
- <li class="covered" data-hits="101" data-linenumber="27">
- <span class="hits">101</span>
+ <li class="covered" data-hits="56" data-linenumber="27">
+ <span class="hits">56</span>
<code class="ruby"> @items = item.fetch('items', [])</code>
</li>
<li class="never" data-hits="" data-linenumber="28">
@@ -811,13 +601,13 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_dump</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="32">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="32">
+
<code class="ruby"> super.merge(endpoint: endpoint)</code>
</li>
<li class="never" data-hits="" data-linenumber="33">
@@ -841,49 +631,49 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_load(raw_object)</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="37">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="37">
+
<code class="ruby"> super</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="38">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="38">
+
<code class="ruby"> @endpoint = raw_object[:endpoint]</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="39">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="39">
+
<code class="ruby"> @total = raw.fetch('total', nil)</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="40">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="40">
+
<code class="ruby"> @limit = raw.fetch('limit', nil)</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="41">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="41">
+
<code class="ruby"> @skip = raw.fetch('skip', nil)</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="42">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="42">
+
<code class="ruby"> @items = raw.fetch('items', []).map do |item|</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="43">
- <span class="hits">7</span>
+ <li class="missed" data-hits="0" data-linenumber="43">
+
<code class="ruby"> require_relative 'resource_builder'</code>
</li>
<li class="never" data-hits="" data-linenumber="44">
@@ -901,19 +691,19 @@
<code class="ruby"> raw_object[:configuration].merge(includes_for_single: Support.includes_from_response(raw, false)),</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="47">
- <span class="hits">7</span>
+ <li class="missed" data-hits="0" data-linenumber="47">
+
<code class="ruby"> item.respond_to?(:localized) ? item.localized : false</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="48">
- <span class="hits">7</span>
+ <li class="missed" data-hits="0" data-linenumber="48">
+
<code class="ruby"> ).run</code>
</li>
<li class="never" data-hits="" data-linenumber="49">
@@ -943,13 +733,13 @@
<span class="hits">1</span>
<code class="ruby"> def inspect</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="54">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="54">
+
<code class="ruby"> "<#{repr_name} total=#{total} skip=#{skip} limit=#{limit}>"</code>
</li>
<li class="never" data-hits="" data-linenumber="55">
@@ -985,43 +775,43 @@
<span class="hits">1</span>
<code class="ruby"> def next_page(client = nil)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="61">
+
<code class="ruby"> return false if client.nil?</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="62">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="62">
+
<code class="ruby"> return false if items.first.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="63">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="64">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="64">
+
<code class="ruby"> new_skip = (skip || 0) + (limit || DEFAULT_LIMIT)</code>
</li>
<li class="never" data-hits="" data-linenumber="65">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="66">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="66">
+
<code class="ruby"> plurals = {</code>
</li>
<li class="never" data-hits="" data-linenumber="67">
@@ -1057,13 +847,13 @@
<code class="ruby"> }</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"> client.public_send(plurals[items.first.type], limit: limit, skip: new_skip)</code>
</li>
<li class="never" data-hits="" data-linenumber="74">
@@ -1089,15 +879,15 @@
<div class="source_table" id="bc50260d115630bb3b54a3ab26a820be409e35fe">
<div class="header">
<h3>lib/contentful/array_like.rb</h3>
- <h4><span class="yellow">82.35 %</span> covered</h4>
+ <h4><span class="red">76.47 %</span> covered</h4>
<div>
<b>17</b> relevant lines.
- <span class="green"><b>14</b> lines covered</span> and
- <span class="red"><b>3</b> lines missed.</span>
+ <span class="green"><b>13</b> lines covered</span> and
+ <span class="red"><b>4</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -1202,12 +992,12 @@
<span class="hits">1</span>
<code class="ruby"> def each_item(&block)</code>
</li>
- <li class="covered" data-hits="101" data-linenumber="18">
- <span class="hits">101</span>
+ <li class="covered" data-hits="58" data-linenumber="18">
+ <span class="hits">58</span>
<code class="ruby"> items.each(&block)</code>
</li>
<li class="never" data-hits="" data-linenumber="19">
@@ -1250,12 +1040,12 @@
<span class="hits">1</span>
<code class="ruby"> def empty?</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="26">
- <span class="hits">5</span>
+ <li class="covered" data-hits="3" data-linenumber="26">
+ <span class="hits">3</span>
<code class="ruby"> items.empty?</code>
</li>
<li class="never" data-hits="" data-linenumber="27">
@@ -1382,13 +1172,13 @@
<span class="hits">1</span>
<code class="ruby"> def last</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="48">
- <span class="hits">4</span>
+ <li class="missed" data-hits="0" data-linenumber="48">
+
<code class="ruby"> items.last</code>
</li>
<li class="never" data-hits="" data-linenumber="49">
@@ -1414,15 +1204,15 @@
<div class="source_table" id="167545c06de91266c75254299e80bf4aa23830c5">
<div class="header">
<h3>lib/contentful/asset.rb</h3>
- <h4><span class="green">95.0 %</span> covered</h4>
+ <h4><span class="green">92.5 %</span> covered</h4>
<div>
<b>40</b> relevant lines.
- <span class="green"><b>38</b> lines covered</span> and
- <span class="red"><b>2</b> lines missed.</span>
+ <span class="green"><b>37</b> lines covered</span> and
+ <span class="red"><b>3</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -1497,12 +1287,12 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_dump</code>
</li>
- <li class="covered" data-hits="19" data-linenumber="13">
- <span class="hits">19</span>
+ <li class="covered" data-hits="10" data-linenumber="13">
+ <span class="hits">10</span>
<code class="ruby"> {</code>
</li>
<li class="never" data-hits="" data-linenumber="14">
@@ -1545,24 +1335,24 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_load(raw_object)</code>
</li>
- <li class="covered" data-hits="19" data-linenumber="21">
- <span class="hits">19</span>
+ <li class="covered" data-hits="10" data-linenumber="21">
+ <span class="hits">10</span>
<code class="ruby"> super(raw_object)</code>
</li>
- <li class="covered" data-hits="19" data-linenumber="22">
- <span class="hits">19</span>
+ <li class="covered" data-hits="10" data-linenumber="22">
+ <span class="hits">10</span>
<code class="ruby"> create_files!</code>
</li>
- <li class="covered" data-hits="19" data-linenumber="23">
- <span class="hits">19</span>
+ <li class="covered" data-hits="10" data-linenumber="23">
+ <span class="hits">10</span>
<code class="ruby"> define_asset_methods!</code>
</li>
<li class="never" data-hits="" data-linenumber="24">
@@ -1611,24 +1401,24 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(*)</code>
</li>
- <li class="covered" data-hits="1482" data-linenumber="32">
- <span class="hits">1482</span>
+ <li class="covered" data-hits="483" data-linenumber="32">
+ <span class="hits">483</span>
<code class="ruby"> super</code>
</li>
- <li class="covered" data-hits="1482" data-linenumber="33">
- <span class="hits">1482</span>
+ <li class="covered" data-hits="483" data-linenumber="33">
+ <span class="hits">483</span>
<code class="ruby"> create_files!</code>
</li>
- <li class="covered" data-hits="1482" data-linenumber="34">
- <span class="hits">1482</span>
+ <li class="covered" data-hits="483" data-linenumber="34">
+ <span class="hits">483</span>
<code class="ruby"> define_asset_methods!</code>
</li>
<li class="never" data-hits="" data-linenumber="35">
@@ -1731,43 +1521,43 @@
<span class="hits">1</span>
<code class="ruby"> def image_url(options = {})</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="52">
- <span class="hits">17</span>
+ <li class="covered" data-hits="4" data-linenumber="52">
+ <span class="hits">4</span>
<code class="ruby"> query = build_query(options)</code>
</li>
<li class="never" data-hits="" data-linenumber="53">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="17" data-linenumber="54">
- <span class="hits">17</span>
+ <li class="covered" data-hits="4" data-linenumber="54">
+ <span class="hits">4</span>
<code class="ruby"> if query.empty?</code>
</li>
- <li class="covered" data-hits="15" data-linenumber="55">
- <span class="hits">15</span>
+ <li class="covered" data-hits="4" data-linenumber="55">
+ <span class="hits">4</span>
<code class="ruby"> file.url</code>
</li>
<li class="never" data-hits="" data-linenumber="56">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="57">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="57">
+
<code class="ruby"> "#{file.url}?#{URI.encode_www_form(query)}"</code>
</li>
<li class="never" data-hits="" data-linenumber="58">
@@ -1875,12 +1665,12 @@
<code class="ruby"> fl: options[:fl]</code>
</li>
- <li class="covered" data-hits="170" data-linenumber="76">
- <span class="hits">170</span>
+ <li class="covered" data-hits="40" data-linenumber="76">
+ <span class="hits">40</span>
<code class="ruby"> }.reject { |_k, v| v.nil? }</code>
</li>
<li class="never" data-hits="" data-linenumber="77">
@@ -1899,48 +1689,48 @@
<span class="hits">1</span>
<code class="ruby"> def create_files!</code>
</li>
- <li class="covered" data-hits="1501" data-linenumber="80">
- <span class="hits">1501</span>
+ <li class="covered" data-hits="493" data-linenumber="80">
+ <span class="hits">493</span>
<code class="ruby"> file_json = raw.fetch('fields', {}).fetch('file', nil)</code>
</li>
- <li class="covered" data-hits="1501" data-linenumber="81">
- <span class="hits">1501</span>
+ <li class="covered" data-hits="493" data-linenumber="81">
+ <span class="hits">493</span>
<code class="ruby"> return if file_json.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="82">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="2994" data-linenumber="83">
- <span class="hits">2994</span>
+ <li class="covered" data-hits="987" data-linenumber="83">
+ <span class="hits">987</span>
<code class="ruby"> is_localized = file_json.keys.none? { |f| %w[fileName contentType details url].include? f }</code>
</li>
- <li class="covered" data-hits="1496" data-linenumber="84">
- <span class="hits">1496</span>
+ <li class="covered" data-hits="493" data-linenumber="84">
+ <span class="hits">493</span>
<code class="ruby"> if is_localized</code>
</li>
- <li class="covered" data-hits="737" data-linenumber="85">
- <span class="hits">737</span>
+ <li class="covered" data-hits="46" data-linenumber="85">
+ <span class="hits">46</span>
<code class="ruby"> locales.each do |locale|</code>
</li>
- <li class="covered" data-hits="739" data-linenumber="86">
- <span class="hits">739</span>
+ <li class="covered" data-hits="47" data-linenumber="86">
+ <span class="hits">47</span>
<code class="ruby"> @fields[locale][:file] = ::Contentful::File.new(file_json[locale.to_s] || {}, @configuration)</code>
</li>
<li class="never" data-hits="" data-linenumber="87">
@@ -1953,12 +1743,12 @@
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="759" data-linenumber="89">
- <span class="hits">759</span>
+ <li class="covered" data-hits="447" data-linenumber="89">
+ <span class="hits">447</span>
<code class="ruby"> @fields[internal_resource_locale][:file] = ::Contentful::File.new(file_json, @configuration)</code>
</li>
<li class="never" data-hits="" data-linenumber="90">
@@ -1983,12 +1773,12 @@
<span class="hits">1</span>
<code class="ruby"> def define_asset_methods!</code>
</li>
- <li class="covered" data-hits="1501" data-linenumber="94">
- <span class="hits">1501</span>
+ <li class="covered" data-hits="493" data-linenumber="94">
+ <span class="hits">493</span>
<code class="ruby"> define_singleton_method :description do</code>
</li>
<li class="missed" data-hits="0" data-linenumber="95">
@@ -2007,18 +1797,18 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1501" data-linenumber="98">
- <span class="hits">1501</span>
+ <li class="covered" data-hits="493" data-linenumber="98">
+ <span class="hits">493</span>
<code class="ruby"> define_singleton_method :file do |wanted_locale = nil|</code>
</li>
- <li class="covered" data-hits="41" data-linenumber="99">
- <span class="hits">41</span>
+ <li class="covered" data-hits="6" data-linenumber="99">
+ <span class="hits">6</span>
<code class="ruby"> fields(wanted_locale)[:file]</code>
</li>
<li class="never" data-hits="" data-linenumber="100">
@@ -2051,15 +1841,15 @@
<div class="source_table" id="c9e25d4e0351ac49d13d793c5d0d6e10c428977b">
<div class="header">
<h3>lib/contentful/base_resource.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="yellow">88.0 %</span> covered</h4>
<div>
<b>50</b> relevant lines.
- <span class="green"><b>50</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>44</b> lines covered</span> and
+ <span class="red"><b>6</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -2116,54 +1906,54 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(item, configuration = {}, _localized = false, _includes = [], entries = {}, depth = 0, _errors = [])</code>
</li>
- <li class="covered" data-hits="8659" data-linenumber="10">
- <span class="hits">8659</span>
+ <li class="covered" data-hits="2902" data-linenumber="10">
+ <span class="hits">2902</span>
<code class="ruby"> entries["#{item['sys']['type']}:#{item['sys']['id']}"] = self if entries && item.key?('sys')</code>
</li>
- <li class="covered" data-hits="8659" data-linenumber="11">
- <span class="hits">8659</span>
+ <li class="covered" data-hits="2902" data-linenumber="11">
+ <span class="hits">2902</span>
<code class="ruby"> @raw = item</code>
</li>
- <li class="covered" data-hits="8659" data-linenumber="12">
- <span class="hits">8659</span>
+ <li class="covered" data-hits="2902" data-linenumber="12">
+ <span class="hits">2902</span>
<code class="ruby"> @default_locale = configuration[:default_locale]</code>
</li>
- <li class="covered" data-hits="8659" data-linenumber="13">
- <span class="hits">8659</span>
+ <li class="covered" data-hits="2902" data-linenumber="13">
+ <span class="hits">2902</span>
<code class="ruby"> @depth = depth</code>
</li>
- <li class="covered" data-hits="8659" data-linenumber="14">
- <span class="hits">8659</span>
+ <li class="covered" data-hits="2902" data-linenumber="14">
+ <span class="hits">2902</span>
<code class="ruby"> @configuration = configuration</code>
</li>
- <li class="covered" data-hits="8659" data-linenumber="15">
- <span class="hits">8659</span>
+ <li class="covered" data-hits="2902" data-linenumber="15">
+ <span class="hits">2902</span>
<code class="ruby"> @sys = hydrate_sys</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="8659" data-linenumber="17">
- <span class="hits">8659</span>
+ <li class="covered" data-hits="2902" data-linenumber="17">
+ <span class="hits">2902</span>
<code class="ruby"> define_sys_methods!</code>
</li>
<li class="never" data-hits="" data-linenumber="18">
@@ -2188,13 +1978,13 @@
<span class="hits">1</span>
<code class="ruby"> def inspect</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="22">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="22">
+
<code class="ruby"> "<#{repr_name} id='#{sys[:id]}'>"</code>
</li>
<li class="never" data-hits="" data-linenumber="23">
@@ -2218,13 +2008,13 @@
<span class="hits">1</span>
<code class="ruby"> def ==(other)</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="27">
- <span class="hits">5</span>
+ <li class="missed" data-hits="0" data-linenumber="27">
+
<code class="ruby"> self.class == other.class && sys[:id] == other.sys[:id]</code>
</li>
<li class="never" data-hits="" data-linenumber="28">
@@ -2248,13 +2038,13 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_dump</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="32">
- <span class="hits">7</span>
+ <li class="missed" data-hits="0" data-linenumber="32">
+
<code class="ruby"> {</code>
</li>
<li class="never" data-hits="" data-linenumber="33">
@@ -2296,42 +2086,42 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_load(raw_object)</code>
</li>
- <li class="covered" data-hits="52" data-linenumber="40">
- <span class="hits">52</span>
+ <li class="covered" data-hits="31" data-linenumber="40">
+ <span class="hits">31</span>
<code class="ruby"> @raw = raw_object[:raw]</code>
</li>
- <li class="covered" data-hits="52" data-linenumber="41">
- <span class="hits">52</span>
+ <li class="covered" data-hits="31" data-linenumber="41">
+ <span class="hits">31</span>
<code class="ruby"> @configuration = raw_object[:configuration]</code>
</li>
- <li class="covered" data-hits="52" data-linenumber="42">
- <span class="hits">52</span>
+ <li class="covered" data-hits="31" data-linenumber="42">
+ <span class="hits">31</span>
<code class="ruby"> @default_locale = @configuration[:default_locale]</code>
</li>
- <li class="covered" data-hits="52" data-linenumber="43">
- <span class="hits">52</span>
+ <li class="covered" data-hits="31" data-linenumber="43">
+ <span class="hits">31</span>
<code class="ruby"> @sys = hydrate_sys</code>
</li>
- <li class="covered" data-hits="52" data-linenumber="44">
- <span class="hits">52</span>
+ <li class="covered" data-hits="31" data-linenumber="44">
+ <span class="hits">31</span>
<code class="ruby"> @depth = 0</code>
</li>
- <li class="covered" data-hits="52" data-linenumber="45">
- <span class="hits">52</span>
+ <li class="covered" data-hits="31" data-linenumber="45">
+ <span class="hits">31</span>
<code class="ruby"> define_sys_methods!</code>
</li>
<li class="never" data-hits="" data-linenumber="46">
@@ -2362,25 +2152,25 @@
<span class="hits">1</span>
<code class="ruby"> def reload(client = nil)</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"> return client.send(Support.snakify(self.class.name.split('::').last), id) unless client.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="52">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="53">
+
<code class="ruby"> false</code>
</li>
<li class="never" data-hits="" data-linenumber="54">
@@ -2410,24 +2200,24 @@
<span class="hits">1</span>
<code class="ruby"> def define_sys_methods!</code>
</li>
- <li class="covered" data-hits="8711" data-linenumber="59">
- <span class="hits">8711</span>
+ <li class="covered" data-hits="2933" data-linenumber="59">
+ <span class="hits">2933</span>
<code class="ruby"> @sys.each do |k, v|</code>
</li>
- <li class="covered" data-hits="39226" data-linenumber="60">
- <span class="hits">39226</span>
+ <li class="covered" data-hits="13586" data-linenumber="60">
+ <span class="hits">13586</span>
<code class="ruby"> define_singleton_method k do</code>
</li>
- <li class="covered" data-hits="18253" data-linenumber="61">
- <span class="hits">18253</span>
+ <li class="covered" data-hits="6409" data-linenumber="61">
+ <span class="hits">6409</span>
<code class="ruby"> v</code>
</li>
<li class="never" data-hits="" data-linenumber="62">
@@ -2458,66 +2248,66 @@
<span class="hits">1</span>
<code class="ruby"> def hydrate_sys</code>
</li>
- <li class="covered" data-hits="8711" data-linenumber="67">
- <span class="hits">8711</span>
+ <li class="covered" data-hits="2933" data-linenumber="67">
+ <span class="hits">2933</span>
<code class="ruby"> result = {}</code>
</li>
- <li class="covered" data-hits="8711" data-linenumber="68">
- <span class="hits">8711</span>
+ <li class="covered" data-hits="2933" data-linenumber="68">
+ <span class="hits">2933</span>
<code class="ruby"> raw.fetch('sys', {}).each do |k, v|</code>
</li>
- <li class="covered" data-hits="39226" data-linenumber="69">
- <span class="hits">39226</span>
+ <li class="covered" data-hits="13586" data-linenumber="69">
+ <span class="hits">13586</span>
<code class="ruby"> if %w[space contentType environment].include?(k)</code>
</li>
- <li class="covered" data-hits="5057" data-linenumber="70">
- <span class="hits">5057</span>
+ <li class="covered" data-hits="1708" data-linenumber="70">
+ <span class="hits">1708</span>
<code class="ruby"> v = build_link(v)</code>
</li>
- <li class="covered" data-hits="34169" data-linenumber="71">
- <span class="hits">34169</span>
+ <li class="covered" data-hits="11878" data-linenumber="71">
+ <span class="hits">11878</span>
<code class="ruby"> elsif %w[createdAt updatedAt deletedAt].include?(k)</code>
</li>
- <li class="covered" data-hits="6724" data-linenumber="72">
- <span class="hits">6724</span>
+ <li class="covered" data-hits="2208" data-linenumber="72">
+ <span class="hits">2208</span>
<code class="ruby"> v = DateTime.parse(v)</code>
</li>
<li class="never" data-hits="" data-linenumber="73">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="39226" data-linenumber="74">
- <span class="hits">39226</span>
+ <li class="covered" data-hits="13586" data-linenumber="74">
+ <span class="hits">13586</span>
<code class="ruby"> result[Support.snakify(k, @configuration[:use_camel_case]).to_sym] = v</code>
</li>
<li class="never" data-hits="" data-linenumber="75">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="8711" data-linenumber="76">
- <span class="hits">8711</span>
+ <li class="covered" data-hits="2933" data-linenumber="76">
+ <span class="hits">2933</span>
<code class="ruby"> result</code>
</li>
<li class="never" data-hits="" data-linenumber="77">
@@ -2548,13 +2338,13 @@
<span class="hits">1</span>
<code class="ruby"> def repr_name</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="82">
- <span class="hits">4</span>
+ <li class="missed" data-hits="0" data-linenumber="82">
+
<code class="ruby"> self.class</code>
</li>
<li class="never" data-hits="" data-linenumber="83">
@@ -2572,12 +2362,12 @@
<span class="hits">1</span>
<code class="ruby"> def internal_resource_locale</code>
</li>
- <li class="covered" data-hits="7428" data-linenumber="86">
- <span class="hits">7428</span>
+ <li class="covered" data-hits="2852" data-linenumber="86">
+ <span class="hits">2852</span>
<code class="ruby"> sys.fetch(:locale, nil) || default_locale</code>
</li>
<li class="never" data-hits="" data-linenumber="87">
@@ -2596,18 +2386,18 @@
<span class="hits">1</span>
<code class="ruby"> def build_link(item)</code>
</li>
- <li class="covered" data-hits="5213" data-linenumber="90">
- <span class="hits">5213</span>
+ <li class="covered" data-hits="1773" data-linenumber="90">
+ <span class="hits">1773</span>
<code class="ruby"> require_relative 'link'</code>
</li>
- <li class="covered" data-hits="5213" data-linenumber="91">
- <span class="hits">5213</span>
+ <li class="covered" data-hits="1773" data-linenumber="91">
+ <span class="hits">1773</span>
<code class="ruby"> ::Contentful::Link.new(item, @configuration)</code>
</li>
<li class="never" data-hits="" data-linenumber="92">
@@ -2634,15 +2424,15 @@
<div class="source_table" id="b0e31f234acd83c871a193ce29ed6b38e9adc98e">
<div class="header">
<h3>lib/contentful/client.rb</h3>
- <h4><span class="green">96.69 %</span> covered</h4>
+ <h4><span class="yellow">82.12 %</span> covered</h4>
<div>
<b>151</b> relevant lines.
- <span class="green"><b>146</b> lines covered</span> and
- <span class="red"><b>5</b> lines missed.</span>
+ <span class="green"><b>124</b> lines covered</span> and
+ <span class="red"><b>27</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -2951,12 +2741,12 @@
<span class="hits">1</span>
<code class="ruby"> def self.get_http(url, query, headers = {}, proxy = {})</code>
</li>
- <li class="covered" data-hits="213" data-linenumber="52">
- <span class="hits">213</span>
+ <li class="covered" data-hits="58" data-linenumber="52">
+ <span class="hits">58</span>
<code class="ruby"> if proxy[:host]</code>
</li>
<li class="missed" data-hits="0" data-linenumber="53">
@@ -2969,12 +2759,12 @@
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="213" data-linenumber="55">
- <span class="hits">213</span>
+ <li class="covered" data-hits="58" data-linenumber="55">
+ <span class="hits">58</span>
<code class="ruby"> HTTP[headers].get(url, params: query)</code>
</li>
<li class="never" data-hits="" data-linenumber="56">
@@ -3161,42 +2951,42 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(given_configuration = {})</code>
</li>
- <li class="covered" data-hits="222" data-linenumber="87">
- <span class="hits">222</span>
+ <li class="covered" data-hits="47" data-linenumber="87">
+ <span class="hits">47</span>
<code class="ruby"> @configuration = default_configuration.merge(given_configuration)</code>
</li>
- <li class="covered" data-hits="222" data-linenumber="88">
- <span class="hits">222</span>
+ <li class="covered" data-hits="47" data-linenumber="88">
+ <span class="hits">47</span>
<code class="ruby"> normalize_configuration!</code>
</li>
- <li class="covered" data-hits="222" data-linenumber="89">
- <span class="hits">222</span>
+ <li class="covered" data-hits="47" data-linenumber="89">
+ <span class="hits">47</span>
<code class="ruby"> validate_configuration!</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="90">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="90">
+ <span class="hits">47</span>
<code class="ruby"> setup_logger</code>
</li>
<li class="never" data-hits="" data-linenumber="91">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="220" data-linenumber="92">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="92">
+ <span class="hits">47</span>
<code class="ruby"> update_dynamic_entry_cache! if configuration[:dynamic_entries] == :auto</code>
</li>
<li class="never" data-hits="" data-linenumber="93">
@@ -3221,18 +3011,18 @@
<span class="hits">1</span>
<code class="ruby"> def setup_logger</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="97">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="97">
+ <span class="hits">47</span>
<code class="ruby"> @logger = configuration[:logger]</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="98">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="98">
+ <span class="hits">47</span>
<code class="ruby"> logger.level = configuration[:log_level] if logger</code>
</li>
<li class="never" data-hits="" data-linenumber="99">
@@ -3257,12 +3047,12 @@
<span class="hits">1</span>
<code class="ruby"> def proxy_params</code>
</li>
- <li class="covered" data-hits="219" data-linenumber="103">
- <span class="hits">219</span>
+ <li class="covered" data-hits="58" data-linenumber="103">
+ <span class="hits">58</span>
<code class="ruby"> {</code>
</li>
<li class="never" data-hits="" data-linenumber="104">
@@ -3323,12 +3113,12 @@
<span class="hits">1</span>
<code class="ruby"> def default_configuration</code>
</li>
- <li class="covered" data-hits="222" data-linenumber="114">
- <span class="hits">222</span>
+ <li class="covered" data-hits="47" data-linenumber="114">
+ <span class="hits">47</span>
<code class="ruby"> DEFAULT_CONFIGURATION.dup</code>
</li>
<li class="never" data-hits="" data-linenumber="115">
@@ -3377,13 +3167,13 @@
<span class="hits">1</span>
<code class="ruby"> def space(query = {})</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="123">
- <span class="hits">9</span>
+ <li class="missed" data-hits="0" data-linenumber="123">
+
<code class="ruby"> Request.new(self, '', query).get</code>
</li>
<li class="never" data-hits="" data-linenumber="124">
@@ -3437,13 +3227,13 @@
<span class="hits">1</span>
<code class="ruby"> def content_type(id, query = {})</code>
</li>
- <li class="covered" data-hits="23" data-linenumber="133">
- <span class="hits">23</span>
+ <li class="missed" data-hits="0" data-linenumber="133">
+
<code class="ruby"> Request.new(self, environment_url('/content_types'), query, id).get</code>
</li>
<li class="never" data-hits="" data-linenumber="134">
@@ -3491,12 +3281,12 @@
<span class="hits">1</span>
<code class="ruby"> def content_types(query = {})</code>
</li>
- <li class="covered" data-hits="28" data-linenumber="142">
- <span class="hits">28</span>
+ <li class="covered" data-hits="11" data-linenumber="142">
+ <span class="hits">11</span>
<code class="ruby"> Request.new(self, environment_url('/content_types'), query).get</code>
</li>
<li class="never" data-hits="" data-linenumber="143">
@@ -3551,48 +3341,48 @@
<span class="hits">1</span>
<code class="ruby"> def entry(id, query = {})</code>
</li>
- <li class="covered" data-hits="42" data-linenumber="152">
- <span class="hits">42</span>
+ <li class="covered" data-hits="29" data-linenumber="152">
+ <span class="hits">29</span>
<code class="ruby"> normalize_select!(query)</code>
</li>
- <li class="covered" data-hits="42" data-linenumber="153">
- <span class="hits">42</span>
+ <li class="covered" data-hits="29" data-linenumber="153">
+ <span class="hits">29</span>
<code class="ruby"> query['sys.id'] = id</code>
</li>
- <li class="covered" data-hits="42" data-linenumber="154">
- <span class="hits">42</span>
+ <li class="covered" data-hits="29" data-linenumber="154">
+ <span class="hits">29</span>
<code class="ruby"> entries = Request.new(self, environment_url('/entries'), query).get</code>
</li>
<li class="never" data-hits="" data-linenumber="155">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="39" data-linenumber="156">
- <span class="hits">39</span>
+ <li class="covered" data-hits="29" data-linenumber="156">
+ <span class="hits">29</span>
<code class="ruby"> return entries if configuration[:raw_mode]</code>
</li>
<li class="never" data-hits="" data-linenumber="157">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="38" data-linenumber="158">
- <span class="hits">38</span>
+ <li class="covered" data-hits="28" data-linenumber="158">
+ <span class="hits">28</span>
<code class="ruby"> entries.first</code>
</li>
<li class="never" data-hits="" data-linenumber="159">
@@ -3641,18 +3431,18 @@
<span class="hits">1</span>
<code class="ruby"> def entries(query = {})</code>
</li>
- <li class="covered" data-hits="24" data-linenumber="167">
- <span class="hits">24</span>
+ <li class="covered" data-hits="18" data-linenumber="167">
+ <span class="hits">18</span>
<code class="ruby"> normalize_select!(query)</code>
</li>
- <li class="covered" data-hits="24" data-linenumber="168">
- <span class="hits">24</span>
+ <li class="covered" data-hits="18" data-linenumber="168">
+ <span class="hits">18</span>
<code class="ruby"> Request.new(self, environment_url('/entries'), query).get</code>
</li>
<li class="never" data-hits="" data-linenumber="169">
@@ -3707,13 +3497,13 @@
<span class="hits">1</span>
<code class="ruby"> def asset(id, query = {})</code>
</li>
- <li class="covered" data-hits="23" data-linenumber="178">
- <span class="hits">23</span>
+ <li class="missed" data-hits="0" data-linenumber="178">
+
<code class="ruby"> Request.new(self, environment_url('/assets'), query, id).get</code>
</li>
<li class="never" data-hits="" data-linenumber="179">
@@ -3761,19 +3551,19 @@
<span class="hits">1</span>
<code class="ruby"> def assets(query = {})</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="187">
- <span class="hits">9</span>
+ <li class="missed" data-hits="0" data-linenumber="187">
+
<code class="ruby"> normalize_select!(query)</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="188">
- <span class="hits">9</span>
+ <li class="missed" data-hits="0" data-linenumber="188">
+
<code class="ruby"> Request.new(self, environment_url('/assets'), query).get</code>
</li>
<li class="never" data-hits="" data-linenumber="189">
@@ -3821,13 +3611,13 @@
<span class="hits">1</span>
<code class="ruby"> def locales(query = {})</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="197">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="197">
+
<code class="ruby"> Request.new(self, environment_url('/locales'), query).get</code>
</li>
<li class="never" data-hits="" data-linenumber="198">
@@ -3857,12 +3647,12 @@
<span class="hits">1</span>
<code class="ruby"> def base_url</code>
</li>
- <li class="covered" data-hits="203" data-linenumber="203">
- <span class="hits">203</span>
+ <li class="covered" data-hits="58" data-linenumber="203">
+ <span class="hits">58</span>
<code class="ruby"> "http#{configuration[:secure] ? 's' : ''}://#{configuration[:api_url]}/spaces/#{configuration[:space]}"</code>
</li>
<li class="never" data-hits="" data-linenumber="204">
@@ -3893,12 +3683,12 @@
<span class="hits">1</span>
<code class="ruby"> def environment_url(path)</code>
</li>
- <li class="covered" data-hits="188" data-linenumber="209">
- <span class="hits">188</span>
+ <li class="covered" data-hits="58" data-linenumber="209">
+ <span class="hits">58</span>
<code class="ruby"> "/environments/#{configuration[:environment]}#{path}"</code>
</li>
<li class="never" data-hits="" data-linenumber="210">
@@ -3929,24 +3719,24 @@
<span class="hits">1</span>
<code class="ruby"> def format_user_agent_header(key, values)</code>
</li>
- <li class="covered" data-hits="813" data-linenumber="215">
- <span class="hits">813</span>
+ <li class="covered" data-hits="174" data-linenumber="215">
+ <span class="hits">174</span>
<code class="ruby"> header = "#{key} #{values[:name]}"</code>
</li>
- <li class="covered" data-hits="813" data-linenumber="216">
- <span class="hits">813</span>
+ <li class="covered" data-hits="174" data-linenumber="216">
+ <span class="hits">174</span>
<code class="ruby"> header = "#{header}/#{values[:version]}" if values[:version]</code>
</li>
- <li class="covered" data-hits="813" data-linenumber="217">
- <span class="hits">813</span>
+ <li class="covered" data-hits="174" data-linenumber="217">
+ <span class="hits">174</span>
<code class="ruby"> "#{header};"</code>
</li>
<li class="never" data-hits="" data-linenumber="218">
@@ -3977,12 +3767,12 @@
<span class="hits">1</span>
<code class="ruby"> def sdk_info</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="223">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="223">
+ <span class="hits">58</span>
<code class="ruby"> { name: 'contentful.rb', version: ::Contentful::VERSION }</code>
</li>
<li class="never" data-hits="" data-linenumber="224">
@@ -4013,12 +3803,12 @@
<span class="hits">1</span>
<code class="ruby"> def app_info</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="229">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="229">
+ <span class="hits">58</span>
<code class="ruby"> { name: configuration[:application_name], version: configuration[:application_version] }</code>
</li>
<li class="never" data-hits="" data-linenumber="230">
@@ -4049,12 +3839,12 @@
<span class="hits">1</span>
<code class="ruby"> def integration_info</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="235">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="235">
+ <span class="hits">58</span>
<code class="ruby"> { name: configuration[:integration_name], version: configuration[:integration_version] }</code>
</li>
<li class="never" data-hits="" data-linenumber="236">
@@ -4085,12 +3875,12 @@
<span class="hits">1</span>
<code class="ruby"> def platform_info</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="241">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="241">
+ <span class="hits">58</span>
<code class="ruby"> { name: 'ruby', version: RUBY_VERSION }</code>
</li>
<li class="never" data-hits="" data-linenumber="242">
@@ -4121,24 +3911,24 @@
<span class="hits">1</span>
<code class="ruby"> def os_info</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="247">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="247">
+ <span class="hits">58</span>
<code class="ruby"> os_name = case ::RbConfig::CONFIG['host_os']</code>
</li>
<li class="missed" data-hits="0" data-linenumber="248">
<code class="ruby"> when /(cygwin|mingw|mswin|windows)/i then 'Windows'</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="249">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="249">
+ <span class="hits">58</span>
<code class="ruby"> when /(darwin|macruby|mac os)/i then 'macOS'</code>
</li>
<li class="missed" data-hits="0" data-linenumber="250">
@@ -4151,12 +3941,12 @@
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="252">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="252">
+ <span class="hits">58</span>
<code class="ruby"> { name: os_name, version: Gem::Platform.local.version }</code>
</li>
<li class="never" data-hits="" data-linenumber="253">
@@ -4187,12 +3977,12 @@
<span class="hits">1</span>
<code class="ruby"> def contentful_user_agent</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="258">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="258">
+ <span class="hits">58</span>
<code class="ruby"> header = {</code>
</li>
<li class="never" data-hits="" data-linenumber="259">
@@ -4235,42 +4025,42 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="261" data-linenumber="266">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="266">
+ <span class="hits">58</span>
<code class="ruby"> result = []</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="267">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="267">
+ <span class="hits">58</span>
<code class="ruby"> header.each do |key, values|</code>
</li>
- <li class="covered" data-hits="1305" data-linenumber="268">
- <span class="hits">1305</span>
+ <li class="covered" data-hits="290" data-linenumber="268">
+ <span class="hits">290</span>
<code class="ruby"> next unless values[:name]</code>
</li>
- <li class="covered" data-hits="813" data-linenumber="269">
- <span class="hits">813</span>
+ <li class="covered" data-hits="174" data-linenumber="269">
+ <span class="hits">174</span>
<code class="ruby"> result << format_user_agent_header(key, values)</code>
</li>
<li class="never" data-hits="" data-linenumber="270">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="261" data-linenumber="271">
- <span class="hits">261</span>
+ <li class="covered" data-hits="58" data-linenumber="271">
+ <span class="hits">58</span>
<code class="ruby"> result.join(' ')</code>
</li>
<li class="never" data-hits="" data-linenumber="272">
@@ -4301,36 +4091,36 @@
<span class="hits">1</span>
<code class="ruby"> def request_headers</code>
</li>
- <li class="covered" data-hits="225" data-linenumber="277">
- <span class="hits">225</span>
+ <li class="covered" data-hits="58" data-linenumber="277">
+ <span class="hits">58</span>
<code class="ruby"> headers = { 'X-Contentful-User-Agent' => contentful_user_agent }</code>
</li>
- <li class="covered" data-hits="225" data-linenumber="278">
- <span class="hits">225</span>
+ <li class="covered" data-hits="58" data-linenumber="278">
+ <span class="hits">58</span>
<code class="ruby"> headers['Authorization'] = "Bearer #{configuration[:access_token]}" if configuration[:authentication_mechanism] == :header</code>
</li>
- <li class="covered" data-hits="225" data-linenumber="279">
- <span class="hits">225</span>
+ <li class="covered" data-hits="58" data-linenumber="279">
+ <span class="hits">58</span>
<code class="ruby"> headers['Content-Type'] = "application/vnd.contentful.delivery.v#{configuration[:api_version].to_i}+json" if configuration[:api_version]</code>
</li>
- <li class="covered" data-hits="225" data-linenumber="280">
- <span class="hits">225</span>
+ <li class="covered" data-hits="58" data-linenumber="280">
+ <span class="hits">58</span>
<code class="ruby"> headers['Accept-Encoding'] = 'gzip' if configuration[:gzip_encoded]</code>
</li>
- <li class="covered" data-hits="225" data-linenumber="281">
- <span class="hits">225</span>
+ <li class="covered" data-hits="58" data-linenumber="281">
+ <span class="hits">58</span>
<code class="ruby"> headers</code>
</li>
<li class="never" data-hits="" data-linenumber="282">
@@ -4361,30 +4151,30 @@
<span class="hits">1</span>
<code class="ruby"> def request_query(query)</code>
</li>
- <li class="covered" data-hits="217" data-linenumber="287">
- <span class="hits">217</span>
+ <li class="covered" data-hits="58" data-linenumber="287">
+ <span class="hits">58</span>
<code class="ruby"> if configuration[:authentication_mechanism] == :query_string</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="288">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="288">
+
<code class="ruby"> query['access_token'] = configuration[:access_token]</code>
</li>
<li class="never" data-hits="" data-linenumber="289">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="217" data-linenumber="290">
- <span class="hits">217</span>
+ <li class="covered" data-hits="58" data-linenumber="290">
+ <span class="hits">58</span>
<code class="ruby"> query</code>
</li>
<li class="never" data-hits="" data-linenumber="291">
@@ -4433,66 +4223,66 @@
<span class="hits">1</span>
<code class="ruby"> def get(request, build_resource = true)</code>
</li>
- <li class="covered" data-hits="214" data-linenumber="299">
- <span class="hits">214</span>
+ <li class="covered" data-hits="58" data-linenumber="299">
+ <span class="hits">58</span>
<code class="ruby"> retries_left = configuration[:max_rate_limit_retries]</code>
</li>
- <li class="covered" data-hits="214" data-linenumber="300">
- <span class="hits">214</span>
+ <li class="covered" data-hits="58" data-linenumber="300">
+ <span class="hits">58</span>
<code class="ruby"> result = nil</code>
</li>
- <li class="covered" data-hits="214" data-linenumber="301">
- <span class="hits">214</span>
+ <li class="covered" data-hits="58" data-linenumber="301">
+ <span class="hits">58</span>
<code class="ruby"> begin</code>
</li>
- <li class="covered" data-hits="215" data-linenumber="302">
- <span class="hits">215</span>
+ <li class="covered" data-hits="58" data-linenumber="302">
+ <span class="hits">58</span>
<code class="ruby"> response = run_request(request)</code>
</li>
<li class="never" data-hits="" data-linenumber="303">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="215" data-linenumber="304">
- <span class="hits">215</span>
+ <li class="covered" data-hits="58" data-linenumber="304">
+ <span class="hits">58</span>
<code class="ruby"> return response if !build_resource || configuration[:raw_mode]</code>
</li>
<li class="never" data-hits="" data-linenumber="305">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="210" data-linenumber="306">
- <span class="hits">210</span>
+ <li class="covered" data-hits="57" data-linenumber="306">
+ <span class="hits">57</span>
<code class="ruby"> return fail_response(response) if response.status != :ok</code>
</li>
<li class="never" data-hits="" data-linenumber="307">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="201" data-linenumber="308">
- <span class="hits">201</span>
+ <li class="covered" data-hits="56" data-linenumber="308">
+ <span class="hits">56</span>
<code class="ruby"> result = do_build_resource(response)</code>
</li>
<li class="never" data-hits="" data-linenumber="309">
@@ -4517,43 +4307,43 @@
<code class="ruby"> rescue Contentful::RateLimitExceeded => rate_limit_error</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="313">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="313">
+
<code class="ruby"> reset_time = rate_limit_error.reset_time.to_i</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="314">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="314">
+
<code class="ruby"> if should_retry(retries_left, reset_time, configuration[:max_rate_limit_wait])</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="315">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="315">
+
<code class="ruby"> retries_left -= 1</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="316">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="316">
+
<code class="ruby"> logger.info(retry_message(retries_left, reset_time)) if logger</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="317">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="317">
+
<code class="ruby"> sleep(reset_time * Random.new.rand(1.0..1.2))</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="318">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="318">
+
<code class="ruby"> retry</code>
</li>
<li class="never" data-hits="" data-linenumber="319">
@@ -4565,13 +4355,13 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="321">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="321">
+
<code class="ruby"> raise</code>
</li>
<li class="never" data-hits="" data-linenumber="322">
@@ -4583,12 +4373,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="201" data-linenumber="324">
- <span class="hits">201</span>
+ <li class="covered" data-hits="56" data-linenumber="324">
+ <span class="hits">56</span>
<code class="ruby"> result</code>
</li>
<li class="never" data-hits="" data-linenumber="325">
@@ -4613,31 +4403,31 @@
<span class="hits">1</span>
<code class="ruby"> def retry_message(retries_left, reset_time)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="329">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="329">
+
<code class="ruby"> message = 'Contentful API Rate Limit Hit! '</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="330">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="330">
+
<code class="ruby"> message += "Retrying - Retries left: #{retries_left}"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="331">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="331">
+
<code class="ruby"> message += "- Time until reset (seconds): #{reset_time}"</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="332">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="332">
+
<code class="ruby"> message</code>
</li>
<li class="never" data-hits="" data-linenumber="333">
@@ -4661,19 +4451,19 @@
<span class="hits">1</span>
<code class="ruby"> def fail_response(response)</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="337">
- <span class="hits">9</span>
+ <li class="covered" data-hits="1" data-linenumber="337">
+ <span class="hits">1</span>
<code class="ruby"> fail response.object if configuration[:raise_errors]</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="338">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="338">
+
<code class="ruby"> response.object</code>
</li>
<li class="never" data-hits="" data-linenumber="339">
@@ -4697,13 +4487,13 @@
<span class="hits">1</span>
<code class="ruby"> def should_retry(retries_left, reset_time, max_wait)</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="343">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="343">
+
<code class="ruby"> retries_left > 0 && max_wait > reset_time</code>
</li>
<li class="never" data-hits="" data-linenumber="344">
@@ -4733,24 +4523,24 @@
<span class="hits">1</span>
<code class="ruby"> def run_request(request)</code>
</li>
- <li class="covered" data-hits="215" data-linenumber="349">
- <span class="hits">215</span>
+ <li class="covered" data-hits="58" data-linenumber="349">
+ <span class="hits">58</span>
<code class="ruby"> url = request.absolute? ? request.url : base_url + request.url</code>
</li>
- <li class="covered" data-hits="215" data-linenumber="350">
- <span class="hits">215</span>
+ <li class="covered" data-hits="58" data-linenumber="350">
+ <span class="hits">58</span>
<code class="ruby"> logger.info(request: { url: url, query: request.query, header: request_headers }) if logger</code>
</li>
- <li class="covered" data-hits="215" data-linenumber="351">
- <span class="hits">215</span>
+ <li class="covered" data-hits="58" data-linenumber="351">
+ <span class="hits">58</span>
<code class="ruby"> Response.new(</code>
</li>
<li class="never" data-hits="" data-linenumber="352">
@@ -4823,12 +4613,12 @@
<span class="hits">1</span>
<code class="ruby"> def do_build_resource(response)</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="364">
- <span class="hits">201</span>
+ <li class="covered" data-hits="56" data-linenumber="364">
+ <span class="hits">56</span>
<code class="ruby"> logger.debug(response: response) if logger</code>
</li>
<li class="never" data-hits="" data-linenumber="365">
@@ -4847,24 +4637,24 @@
<code class="ruby"> configuration.merge(endpoint: response.request.endpoint),</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="368">
- <span class="hits">201</span>
+ <li class="covered" data-hits="56" data-linenumber="368">
+ <span class="hits">56</span>
<code class="ruby"> (response.request.query || {}).fetch(:locale, nil) == '*',</code>
</li>
<li class="never" data-hits="" data-linenumber="369">
<code class="ruby"> 0</code>
</li>
- <li class="covered" data-hits="201" data-linenumber="370">
- <span class="hits">201</span>
+ <li class="covered" data-hits="56" data-linenumber="370">
+ <span class="hits">56</span>
<code class="ruby"> ).run</code>
</li>
<li class="never" data-hits="" data-linenumber="371">
@@ -4901,24 +4691,24 @@
<span class="hits">1</span>
<code class="ruby"> def update_dynamic_entry_cache!</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="377">
- <span class="hits">17</span>
+ <li class="covered" data-hits="11" data-linenumber="377">
+ <span class="hits">11</span>
<code class="ruby"> return if configuration[:raw_mode]</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="378">
- <span class="hits">17</span>
+ <li class="covered" data-hits="11" data-linenumber="378">
+ <span class="hits">11</span>
<code class="ruby"> content_types(limit: 1000).map do |ct|</code>
</li>
- <li class="covered" data-hits="43" data-linenumber="379">
- <span class="hits">43</span>
+ <li class="covered" data-hits="27" data-linenumber="379">
+ <span class="hits">27</span>
<code class="ruby"> ContentTypeCache.cache_set(configuration[:space], ct.id, ct)</code>
</li>
<li class="never" data-hits="" data-linenumber="380">
@@ -4961,13 +4751,13 @@
<span class="hits">1</span>
<code class="ruby"> def register_dynamic_entry(key, klass)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="387">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="387">
+
<code class="ruby"> ContentTypeCache.cache_set(configuration[:space], key, klass)</code>
</li>
<li class="never" data-hits="" data-linenumber="388">
@@ -5027,13 +4817,13 @@
<span class="hits">1</span>
<code class="ruby"> def sync(options = { initial: true })</code>
</li>
- <li class="covered" data-hits="43" data-linenumber="398">
- <span class="hits">43</span>
+ <li class="missed" data-hits="0" data-linenumber="398">
+
<code class="ruby"> Sync.new(self, options)</code>
</li>
<li class="never" data-hits="" data-linenumber="399">
@@ -5087,36 +4877,36 @@
<span class="hits">1</span>
<code class="ruby"> def normalize_select!(query)</code>
</li>
- <li class="covered" data-hits="75" data-linenumber="408">
- <span class="hits">75</span>
+ <li class="covered" data-hits="47" data-linenumber="408">
+ <span class="hits">47</span>
<code class="ruby"> return unless query.key?(:select)</code>
</li>
<li class="never" data-hits="" data-linenumber="409">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="10" data-linenumber="410">
- <span class="hits">10</span>
+ <li class="covered" data-hits="6" data-linenumber="410">
+ <span class="hits">6</span>
<code class="ruby"> query[:select] = query[:select].split(',').map(&:strip) if query[:select].is_a? String</code>
</li>
- <li class="covered" data-hits="21" data-linenumber="411">
- <span class="hits">21</span>
+ <li class="covered" data-hits="13" data-linenumber="411">
+ <span class="hits">13</span>
<code class="ruby"> query[:select] = query[:select].reject { |p| p.start_with?('sys.') }</code>
</li>
- <li class="covered" data-hits="10" data-linenumber="412">
- <span class="hits">10</span>
+ <li class="covered" data-hits="6" data-linenumber="412">
+ <span class="hits">6</span>
<code class="ruby"> query[:select] << 'sys' unless query[:select].include?('sys')</code>
</li>
<li class="never" data-hits="" data-linenumber="413">
@@ -5135,18 +4925,18 @@
<span class="hits">1</span>
<code class="ruby"> def normalize_configuration!</code>
</li>
- <li class="covered" data-hits="1110" data-linenumber="416">
- <span class="hits">1110</span>
+ <li class="covered" data-hits="235" data-linenumber="416">
+ <span class="hits">235</span>
<code class="ruby"> %i[space access_token api_url default_locale].each { |s| configuration[s] = configuration[s].to_s }</code>
</li>
- <li class="covered" data-hits="222" data-linenumber="417">
- <span class="hits">222</span>
+ <li class="covered" data-hits="47" data-linenumber="417">
+ <span class="hits">47</span>
<code class="ruby"> configuration[:authentication_mechanism] = configuration[:authentication_mechanism].to_sym</code>
</li>
<li class="never" data-hits="" data-linenumber="418">
@@ -5165,42 +4955,42 @@
<span class="hits">1</span>
<code class="ruby"> def validate_configuration!</code>
</li>
- <li class="covered" data-hits="222" data-linenumber="421">
- <span class="hits">222</span>
+ <li class="covered" data-hits="47" data-linenumber="421">
+ <span class="hits">47</span>
<code class="ruby"> fail ArgumentError, 'You will need to initialize a client with a :space' if configuration[:space].empty?</code>
</li>
- <li class="covered" data-hits="221" data-linenumber="422">
- <span class="hits">221</span>
+ <li class="covered" data-hits="47" data-linenumber="422">
+ <span class="hits">47</span>
<code class="ruby"> fail ArgumentError, 'You will need to initialize a client with an :access_token' if configuration[:access_token].empty?</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="423">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="423">
+ <span class="hits">47</span>
<code class="ruby"> fail ArgumentError, 'The client configuration needs to contain an :api_url' if configuration[:api_url].empty?</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="424">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="424">
+ <span class="hits">47</span>
<code class="ruby"> fail ArgumentError, 'The client configuration needs to contain a :default_locale' if configuration[:default_locale].empty?</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="425">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="425">
+ <span class="hits">47</span>
<code class="ruby"> fail ArgumentError, 'The :api_version must be a positive number or nil' unless configuration[:api_version].to_i >= 0</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="426">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="426">
+ <span class="hits">47</span>
<code class="ruby"> fail ArgumentError, 'The authentication mechanism must be :header or :query_string' unless %i[header query_string].include?(</code>
</li>
<li class="never" data-hits="" data-linenumber="427">
@@ -5213,12 +5003,12 @@
<code class="ruby"> )</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="429">
- <span class="hits">220</span>
+ <li class="covered" data-hits="47" data-linenumber="429">
+ <span class="hits">47</span>
<code class="ruby"> fail ArgumentError, 'The :dynamic_entries mode must be :auto or :manual' unless %i[auto manual].include?(</code>
</li>
<li class="never" data-hits="" data-linenumber="430">
@@ -5257,15 +5047,15 @@
<div class="source_table" id="beb22ab5c60eaaa44a2cba4f526b8a2630d7a31a">
<div class="header">
<h3>lib/contentful/coercions.rb</h3>
- <h4><span class="green">94.03 %</span> covered</h4>
+ <h4><span class="green">92.86 %</span> covered</h4>
<div>
- <b>67</b> relevant lines.
- <span class="green"><b>63</b> lines covered</span> and
- <span class="red"><b>4</b> lines missed.</span>
+ <b>70</b> relevant lines.
+ <span class="green"><b>65</b> lines covered</span> and
+ <span class="red"><b>5</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -5310,18 +5100,18 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(value, options = {})</code>
</li>
- <li class="covered" data-hits="6957" data-linenumber="8">
- <span class="hits">6957</span>
+ <li class="covered" data-hits="43" data-linenumber="8">
+ <span class="hits">43</span>
<code class="ruby"> @value = value</code>
</li>
- <li class="covered" data-hits="6957" data-linenumber="9">
- <span class="hits">6957</span>
+ <li class="covered" data-hits="43" data-linenumber="9">
+ <span class="hits">43</span>
<code class="ruby"> @options = options</code>
</li>
<li class="never" data-hits="" data-linenumber="10">
@@ -5346,12 +5136,12 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(*)</code>
</li>
- <li class="covered" data-hits="26" data-linenumber="14">
- <span class="hits">26</span>
+ <li class="covered" data-hits="4" data-linenumber="14">
+ <span class="hits">4</span>
<code class="ruby"> value</code>
</li>
<li class="never" data-hits="" data-linenumber="15">
@@ -5394,12 +5184,12 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(*)</code>
</li>
- <li class="covered" data-hits="3916" data-linenumber="22">
- <span class="hits">3916</span>
+ <li class="covered" data-hits="31" data-linenumber="22">
+ <span class="hits">31</span>
<code class="ruby"> value.to_s</code>
</li>
<li class="never" data-hits="" data-linenumber="23">
@@ -5478,12 +5268,12 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(*)</code>
</li>
- <li class="covered" data-hits="996" data-linenumber="36">
- <span class="hits">996</span>
+ <li class="covered" data-hits="1" data-linenumber="36">
+ <span class="hits">1</span>
<code class="ruby"> value.to_i</code>
</li>
<li class="never" data-hits="" data-linenumber="37">
@@ -5634,31 +5424,31 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(*)</code>
</li>
- <li class="covered" data-hits="1001" data-linenumber="62">
- <span class="hits">1001</span>
+ <li class="missed" data-hits="0" data-linenumber="62">
+
<code class="ruby"> return nil if value.nil?</code>
</li>
- <li class="covered" data-hits="1000" data-linenumber="63">
- <span class="hits">1000</span>
+ <li class="missed" data-hits="0" data-linenumber="63">
+
<code class="ruby"> return value if value.is_a?(Date)</code>
</li>
<li class="never" data-hits="" data-linenumber="64">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="999" data-linenumber="65">
- <span class="hits">999</span>
+ <li class="missed" data-hits="0" data-linenumber="65">
+
<code class="ruby"> DateTime.parse(value)</code>
</li>
<li class="never" data-hits="" data-linenumber="66">
@@ -5700,13 +5490,13 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(*)</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="73">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="73">
+
<code class="ruby"> Location.new(value)</code>
</li>
<li class="never" data-hits="" data-linenumber="74">
@@ -5748,12 +5538,12 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(*)</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="81">
- <span class="hits">7</span>
+ <li class="covered" data-hits="2" data-linenumber="81">
+ <span class="hits">2</span>
<code class="ruby"> JSON.parse(JSON.dump(value), symbolize_names: true)</code>
</li>
<li class="never" data-hits="" data-linenumber="82">
@@ -5832,18 +5622,18 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(*)</code>
</li>
- <li class="covered" data-hits="1007" data-linenumber="95">
- <span class="hits">1007</span>
+ <li class="covered" data-hits="1" data-linenumber="95">
+ <span class="hits">1</span>
<code class="ruby"> value.map do |e|</code>
</li>
- <li class="covered" data-hits="1525" data-linenumber="96">
- <span class="hits">1525</span>
+ <li class="covered" data-hits="2" data-linenumber="96">
+ <span class="hits">2</span>
<code class="ruby"> options[:coercion_class].new(e).coerce</code>
</li>
<li class="never" data-hits="" data-linenumber="97">
@@ -5892,12 +5682,12 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(configuration)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="105">
- <span class="hits">1</span>
+ <li class="covered" data-hits="3" data-linenumber="105">
+ <span class="hits">3</span>
<code class="ruby"> coerce_block(value, configuration)</code>
</li>
<li class="never" data-hits="" data-linenumber="106">
@@ -5928,14 +5718,14 @@
<span class="hits">1</span>
<code class="ruby"> def link?(node)</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="111">
- <span class="hits">17</span>
+ <li class="covered" data-hits="105" data-linenumber="111">
+ <span class="hits">105</span>
- <code class="ruby"> node['nodeClass'] == 'block' && node.key?('data')</code>
+ <code class="ruby"> !node.fetch('data', {}).empty? && node['data']['target']</code>
</li>
<li class="never" data-hits="" data-linenumber="112">
@@ -5952,14 +5742,14 @@
<span class="hits">1</span>
<code class="ruby"> def content_block?(node)</code>
</li>
- <li class="missed" data-hits="0" data-linenumber="115">
+ <li class="covered" data-hits="98" data-linenumber="115">
+ <span class="hits">98</span>
-
- <code class="ruby"> node['nodeClass'] == 'block' && node.key?('content')</code>
+ <code class="ruby"> !node.fetch('content', []).empty?</code>
</li>
<li class="never" data-hits="" data-linenumber="116">
@@ -5976,275 +5766,305 @@
<span class="hits">1</span>
<code class="ruby"> def coerce_block(block, configuration)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="119">
- <span class="hits">1</span>
+ <li class="covered" data-hits="59" data-linenumber="119">
+ <span class="hits">59</span>
<code class="ruby"> return block unless block.is_a?(Hash) && block.key?('content')</code>
</li>
<li class="never" data-hits="" data-linenumber="120">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="121">
- <span class="hits">1</span>
+ <li class="covered" data-hits="59" data-linenumber="121">
+ <span class="hits">59</span>
<code class="ruby"> invalid_nodes = []</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="122">
- <span class="hits">1</span>
+ <li class="covered" data-hits="59" data-linenumber="122">
+ <span class="hits">59</span>
+ <code class="ruby"> coerced_nodes = {}</code>
+ </li>
+
+ <li class="covered" data-hits="59" data-linenumber="123">
+ <span class="hits">59</span>
+
<code class="ruby"> block['content'].each_with_index do |node, index|</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="123">
- <span class="hits">17</span>
+ <li class="covered" data-hits="105" data-linenumber="124">
+ <span class="hits">105</span>
<code class="ruby"> if link?(node)</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="124">
- <span class="hits">17</span>
+ <li class="covered" data-hits="7" data-linenumber="125">
+ <span class="hits">7</span>
<code class="ruby"> link = coerce_link(node, configuration)</code>
</li>
- <li class="never" data-hits="" data-linenumber="125">
+ <li class="never" data-hits="" data-linenumber="126">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="17" data-linenumber="126">
- <span class="hits">17</span>
+ <li class="covered" data-hits="7" data-linenumber="127">
+ <span class="hits">7</span>
<code class="ruby"> if !link.nil?</code>
</li>
- <li class="covered" data-hits="16" data-linenumber="127">
- <span class="hits">16</span>
+ <li class="covered" data-hits="6" data-linenumber="128">
+ <span class="hits">6</span>
<code class="ruby"> node['data'] = link</code>
</li>
- <li class="never" data-hits="" data-linenumber="128">
+ <li class="never" data-hits="" data-linenumber="129">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="129">
+ <li class="covered" data-hits="1" data-linenumber="130">
<span class="hits">1</span>
<code class="ruby"> invalid_nodes << index</code>
</li>
- <li class="never" data-hits="" data-linenumber="130">
+ <li class="never" data-hits="" data-linenumber="131">
<code class="ruby"> end</code>
</li>
- <li class="missed" data-hits="0" data-linenumber="131">
+ <li class="covered" data-hits="98" data-linenumber="132">
+ <span class="hits">98</span>
-
<code class="ruby"> elsif content_block?(node)</code>
</li>
- <li class="missed" data-hits="0" data-linenumber="132">
+ <li class="covered" data-hits="56" data-linenumber="133">
+ <span class="hits">56</span>
-
- <code class="ruby"> node['content'] = coerce_block(node, configuration)</code>
+ <code class="ruby"> coerced_nodes[index] = coerce_block(node, configuration)</code>
</li>
- <li class="never" data-hits="" data-linenumber="133">
+ <li class="never" data-hits="" data-linenumber="134">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="134">
+ <li class="never" data-hits="" data-linenumber="135">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="135">
+ <li class="never" data-hits="" data-linenumber="136">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="136">
- <span class="hits">1</span>
+ <li class="covered" data-hits="59" data-linenumber="137">
+ <span class="hits">59</span>
+ <code class="ruby"> coerced_nodes.each do |index, coerced_node|</code>
+ </li>
+
+ <li class="covered" data-hits="56" data-linenumber="138">
+ <span class="hits">56</span>
+
+ <code class="ruby"> block['content'][index] = coerced_node</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="139">
+
+
+ <code class="ruby"> end</code>
+ </li>
+
+ <li class="never" data-hits="" data-linenumber="140">
+
+
+ <code class="ruby"></code>
+ </li>
+
+ <li class="covered" data-hits="59" data-linenumber="141">
+ <span class="hits">59</span>
+
<code class="ruby"> invalid_nodes.each do |index|</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="137">
+ <li class="covered" data-hits="1" data-linenumber="142">
<span class="hits">1</span>
<code class="ruby"> block['content'].delete_at(index)</code>
</li>
- <li class="never" data-hits="" data-linenumber="138">
+ <li class="never" data-hits="" data-linenumber="143">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="139">
+ <li class="never" data-hits="" data-linenumber="144">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="140">
- <span class="hits">1</span>
+ <li class="covered" data-hits="59" data-linenumber="145">
+ <span class="hits">59</span>
<code class="ruby"> block</code>
</li>
- <li class="never" data-hits="" data-linenumber="141">
+ <li class="never" data-hits="" data-linenumber="146">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="142">
+ <li class="never" data-hits="" data-linenumber="147">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1" data-linenumber="143">
+ <li class="covered" data-hits="1" data-linenumber="148">
<span class="hits">1</span>
<code class="ruby"> def coerce_link(node, configuration)</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="144">
- <span class="hits">17</span>
+ <li class="covered" data-hits="7" data-linenumber="149">
+ <span class="hits">7</span>
<code class="ruby"> return node unless node.key?('data') && node['data'].key?('target')</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="145">
- <span class="hits">3</span>
+ <li class="covered" data-hits="7" data-linenumber="150">
+ <span class="hits">7</span>
<code class="ruby"> return node unless node['data']['target']['sys']['type'] == 'Link'</code>
</li>
- <li class="never" data-hits="" data-linenumber="146">
+ <li class="never" data-hits="" data-linenumber="151">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3" data-linenumber="147">
- <span class="hits">3</span>
+ <li class="covered" data-hits="7" data-linenumber="152">
+ <span class="hits">7</span>
<code class="ruby"> return nil if Support.unresolvable?(node['data']['target'], configuration[:errors])</code>
</li>
- <li class="never" data-hits="" data-linenumber="148">
+ <li class="never" data-hits="" data-linenumber="153">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="2" data-linenumber="149">
- <span class="hits">2</span>
+ <li class="covered" data-hits="6" data-linenumber="154">
+ <span class="hits">6</span>
<code class="ruby"> resource = Support.resource_for_link(</code>
</li>
- <li class="never" data-hits="" data-linenumber="150">
+ <li class="never" data-hits="" data-linenumber="155">
<code class="ruby"> node['data']['target'],</code>
</li>
- <li class="never" data-hits="" data-linenumber="151">
+ <li class="never" data-hits="" data-linenumber="156">
<code class="ruby"> configuration[:includes_for_single]</code>
</li>
- <li class="never" data-hits="" data-linenumber="152">
+ <li class="never" data-hits="" data-linenumber="157">
<code class="ruby"> )</code>
</li>
- <li class="never" data-hits="" data-linenumber="153">
+ <li class="never" data-hits="" data-linenumber="158">
<code class="ruby"></code>
</li>
- <li class="never" data-hits="" data-linenumber="154">
+ <li class="never" data-hits="" data-linenumber="159">
<code class="ruby"> ResourceBuilder.new(</code>
</li>
- <li class="never" data-hits="" data-linenumber="155">
+ <li class="never" data-hits="" data-linenumber="160">
<code class="ruby"> resource,</code>
</li>
- <li class="never" data-hits="" data-linenumber="156">
+ <li class="never" data-hits="" data-linenumber="161">
<code class="ruby"> configuration,</code>
</li>
- <li class="never" data-hits="" data-linenumber="157">
+ <li class="never" data-hits="" data-linenumber="162">
<code class="ruby"> configuration[:localized],</code>
</li>
- <li class="never" data-hits="" data-linenumber="158">
+ <li class="never" data-hits="" data-linenumber="163">
<code class="ruby"> configuration[:depth] + 1,</code>
</li>
- <li class="never" data-hits="" data-linenumber="159">
+ <li class="never" data-hits="" data-linenumber="164">
<code class="ruby"> configuration[:errors]</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="160">
- <span class="hits">2</span>
+ <li class="covered" data-hits="6" data-linenumber="165">
+ <span class="hits">6</span>
<code class="ruby"> ).run</code>
</li>
- <li class="never" data-hits="" data-linenumber="161">
+ <li class="never" data-hits="" data-linenumber="166">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="162">
+ <li class="never" data-hits="" data-linenumber="167">
<code class="ruby"> end</code>
</li>
- <li class="never" data-hits="" data-linenumber="163">
+ <li class="never" data-hits="" data-linenumber="168">
<code class="ruby">end</code>
</li>
@@ -6331,42 +6151,42 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(item, *)</code>
</li>
- <li class="covered" data-hits="115" data-linenumber="12">
- <span class="hits">115</span>
+ <li class="covered" data-hits="27" data-linenumber="12">
+ <span class="hits">27</span>
<code class="ruby"> super</code>
</li>
<li class="never" data-hits="" data-linenumber="13">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="115" data-linenumber="14">
- <span class="hits">115</span>
+ <li class="covered" data-hits="27" data-linenumber="14">
+ <span class="hits">27</span>
<code class="ruby"> @name = item.fetch('name', nil)</code>
</li>
- <li class="covered" data-hits="115" data-linenumber="15">
- <span class="hits">115</span>
+ <li class="covered" data-hits="27" data-linenumber="15">
+ <span class="hits">27</span>
<code class="ruby"> @description = item.fetch('description', nil)</code>
</li>
- <li class="covered" data-hits="673" data-linenumber="16">
- <span class="hits">673</span>
+ <li class="covered" data-hits="97" data-linenumber="16">
+ <span class="hits">97</span>
<code class="ruby"> @fields = item.fetch('fields', []).map { |field| Field.new(field) }</code>
</li>
- <li class="covered" data-hits="115" data-linenumber="17">
- <span class="hits">115</span>
+ <li class="covered" data-hits="27" data-linenumber="17">
+ <span class="hits">27</span>
<code class="ruby"> @display_field = item.fetch('displayField', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="18">
@@ -6391,12 +6211,12 @@
<span class="hits">1</span>
<code class="ruby"> def field_for(field_id)</code>
</li>
- <li class="covered" data-hits="24085" data-linenumber="22">
- <span class="hits">24085</span>
+ <li class="covered" data-hits="136" data-linenumber="22">
+ <span class="hits">136</span>
<code class="ruby"> fields.detect { |f| Support.snakify(f.id) == Support.snakify(field_id) }</code>
</li>
<li class="never" data-hits="" data-linenumber="23">
@@ -6471,15 +6291,15 @@
<div class="source_table" id="a46b40f2e6381b7f2ac84d26e7bc008d4e6985eb">
<div class="header">
<h3>lib/contentful/content_type_cache.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="green">91.67 %</span> covered</h4>
<div>
<b>12</b> relevant lines.
- <span class="green"><b>12</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>11</b> lines covered</span> and
+ <span class="red"><b>1</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -6548,13 +6368,13 @@
<span class="hits">1</span>
<code class="ruby"> def self.clear!</code>
</li>
- <li class="covered" data-hits="20" data-linenumber="12">
- <span class="hits">20</span>
+ <li class="missed" data-hits="0" data-linenumber="12">
+
<code class="ruby"> @cache = {}</code>
</li>
<li class="never" data-hits="" data-linenumber="13">
@@ -6578,12 +6398,12 @@
<span class="hits">1</span>
<code class="ruby"> def self.cache_get(space_id, content_type_id)</code>
</li>
- <li class="covered" data-hits="8263" data-linenumber="17">
- <span class="hits">8263</span>
+ <li class="covered" data-hits="2691" data-linenumber="17">
+ <span class="hits">2691</span>
<code class="ruby"> @cache.fetch(space_id, {}).fetch(content_type_id.to_sym, nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="18">
@@ -6608,18 +6428,18 @@
<span class="hits">1</span>
<code class="ruby"> def self.cache_set(space_id, content_type_id, klass)</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="22">
- <span class="hits">44</span>
+ <li class="covered" data-hits="27" data-linenumber="22">
+ <span class="hits">27</span>
<code class="ruby"> @cache[space_id] ||= {}</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="23">
- <span class="hits">44</span>
+ <li class="covered" data-hits="27" data-linenumber="23">
+ <span class="hits">27</span>
<code class="ruby"> @cache[space_id][content_type_id.to_sym] = klass</code>
</li>
<li class="never" data-hits="" data-linenumber="24">
@@ -6768,15 +6588,15 @@
<div class="source_table" id="97df464094b50c0508a4a014acd1a9beace447a1">
<div class="header">
<h3>lib/contentful/entry.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="green">95.45 %</span> covered</h4>
<div>
<b>44</b> relevant lines.
- <span class="green"><b>44</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>42</b> lines covered</span> and
+ <span class="red"><b>2</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -6887,72 +6707,72 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(field_id, value, includes, errors, entries = {})</code>
</li>
- <li class="covered" data-hits="11203" data-linenumber="19">
- <span class="hits">11203</span>
+ <li class="covered" data-hits="3743" data-linenumber="19">
+ <span class="hits">3743</span>
<code class="ruby"> if Support.link?(value) && !Support.unresolvable?(value, errors)</code>
</li>
- <li class="covered" data-hits="2914" data-linenumber="20">
- <span class="hits">2914</span>
+ <li class="covered" data-hits="1038" data-linenumber="20">
+ <span class="hits">1038</span>
<code class="ruby"> return build_nested_resource(value, includes, entries, errors)</code>
</li>
<li class="never" data-hits="" data-linenumber="21">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="8289" data-linenumber="22">
- <span class="hits">8289</span>
+ <li class="covered" data-hits="2705" data-linenumber="22">
+ <span class="hits">2705</span>
<code class="ruby"> return coerce_link_array(value, includes, errors, entries) if Support.link_array?(value)</code>
</li>
<li class="never" data-hits="" data-linenumber="23">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="8263" data-linenumber="24">
- <span class="hits">8263</span>
+ <li class="covered" data-hits="2691" data-linenumber="24">
+ <span class="hits">2691</span>
<code class="ruby"> content_type_key = Support.snakify('contentType', @configuration[:use_camel_case])</code>
</li>
- <li class="covered" data-hits="8263" data-linenumber="25">
- <span class="hits">8263</span>
+ <li class="covered" data-hits="2691" data-linenumber="25">
+ <span class="hits">2691</span>
<code class="ruby"> content_type = ContentTypeCache.cache_get(sys[:space].id, sys[content_type_key.to_sym].id)</code>
</li>
<li class="never" data-hits="" data-linenumber="26">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="8263" data-linenumber="27">
- <span class="hits">8263</span>
+ <li class="covered" data-hits="2691" data-linenumber="27">
+ <span class="hits">2691</span>
<code class="ruby"> unless content_type.nil?</code>
</li>
- <li class="covered" data-hits="5435" data-linenumber="28">
- <span class="hits">5435</span>
+ <li class="covered" data-hits="41" data-linenumber="28">
+ <span class="hits">41</span>
<code class="ruby"> content_type_field = content_type.field_for(field_id)</code>
</li>
- <li class="covered" data-hits="5435" data-linenumber="29">
- <span class="hits">5435</span>
+ <li class="covered" data-hits="41" data-linenumber="29">
+ <span class="hits">41</span>
<code class="ruby"> coercion_configuration = @configuration.merge(</code>
</li>
<li class="never" data-hits="" data-linenumber="30">
@@ -6995,12 +6815,12 @@
<code class="ruby"> )</code>
</li>
- <li class="covered" data-hits="5435" data-linenumber="37">
- <span class="hits">5435</span>
+ <li class="covered" data-hits="41" data-linenumber="37">
+ <span class="hits">41</span>
<code class="ruby"> return content_type_field.coerce(value, coercion_configuration) unless content_type_field.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="38">
@@ -7013,12 +6833,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="2831" data-linenumber="40">
- <span class="hits">2831</span>
+ <li class="covered" data-hits="2650" data-linenumber="40">
+ <span class="hits">2650</span>
<code class="ruby"> super(field_id, value, includes, errors, entries)</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
@@ -7037,30 +6857,30 @@
<span class="hits">1</span>
<code class="ruby"> def coerce_link_array(value, includes, errors, entries)</code>
</li>
- <li class="covered" data-hits="26" data-linenumber="44">
- <span class="hits">26</span>
+ <li class="covered" data-hits="14" data-linenumber="44">
+ <span class="hits">14</span>
<code class="ruby"> items = []</code>
</li>
- <li class="covered" data-hits="26" data-linenumber="45">
- <span class="hits">26</span>
+ <li class="covered" data-hits="14" data-linenumber="45">
+ <span class="hits">14</span>
<code class="ruby"> value.each do |link|</code>
</li>
- <li class="covered" data-hits="42" data-linenumber="46">
- <span class="hits">42</span>
+ <li class="covered" data-hits="26" data-linenumber="46">
+ <span class="hits">26</span>
<code class="ruby"> nested_resource = build_nested_resource(link, includes, entries, errors) unless Support.unresolvable?(link, errors)</code>
</li>
- <li class="covered" data-hits="42" data-linenumber="47">
- <span class="hits">42</span>
+ <li class="covered" data-hits="26" data-linenumber="47">
+ <span class="hits">26</span>
<code class="ruby"> items << nested_resource unless nested_resource.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="48">
@@ -7073,12 +6893,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="26" data-linenumber="50">
- <span class="hits">26</span>
+ <li class="covered" data-hits="14" data-linenumber="50">
+ <span class="hits">14</span>
<code class="ruby"> items</code>
</li>
<li class="never" data-hits="" data-linenumber="51">
@@ -7121,24 +6941,24 @@
<span class="hits">1</span>
<code class="ruby"> def build_nested_resource(value, includes, entries, errors)</code>
</li>
- <li class="covered" data-hits="2954" data-linenumber="58">
- <span class="hits">2954</span>
+ <li class="covered" data-hits="1062" data-linenumber="58">
+ <span class="hits">1062</span>
<code class="ruby"> if @depth < @configuration.fetch(:max_include_resolution_depth, 20)</code>
</li>
- <li class="covered" data-hits="2802" data-linenumber="59">
- <span class="hits">2802</span>
+ <li class="covered" data-hits="997" data-linenumber="59">
+ <span class="hits">997</span>
<code class="ruby"> resource = Support.resource_for_link(value, includes)</code>
</li>
- <li class="covered" data-hits="2802" data-linenumber="60">
- <span class="hits">2802</span>
+ <li class="covered" data-hits="997" data-linenumber="60">
+ <span class="hits">997</span>
<code class="ruby"> return resolve_include(resource, includes, entries, errors) unless resource.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="61">
@@ -7151,12 +6971,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="156" data-linenumber="63">
- <span class="hits">156</span>
+ <li class="covered" data-hits="65" data-linenumber="63">
+ <span class="hits">65</span>
<code class="ruby"> build_link(value)</code>
</li>
<li class="never" data-hits="" data-linenumber="64">
@@ -7175,12 +6995,12 @@
<span class="hits">1</span>
<code class="ruby"> def resolve_include(resource, includes, entries, errors)</code>
</li>
- <li class="covered" data-hits="2798" data-linenumber="67">
- <span class="hits">2798</span>
+ <li class="covered" data-hits="997" data-linenumber="67">
+ <span class="hits">997</span>
<code class="ruby"> require_relative 'resource_builder'</code>
</li>
<li class="never" data-hits="" data-linenumber="68">
@@ -7247,12 +7067,12 @@
<code class="ruby"> errors</code>
</li>
- <li class="covered" data-hits="2798" data-linenumber="79">
- <span class="hits">2798</span>
+ <li class="covered" data-hits="997" data-linenumber="79">
+ <span class="hits">997</span>
<code class="ruby"> ).run</code>
</li>
<li class="never" data-hits="" data-linenumber="80">
@@ -7271,24 +7091,24 @@
<span class="hits">1</span>
<code class="ruby"> def known_link?(name)</code>
</li>
- <li class="covered" data-hits="117" data-linenumber="83">
- <span class="hits">117</span>
+ <li class="covered" data-hits="108" data-linenumber="83">
+ <span class="hits">108</span>
<code class="ruby"> field_name = name.to_sym</code>
</li>
- <li class="covered" data-hits="117" data-linenumber="84">
- <span class="hits">117</span>
+ <li class="covered" data-hits="108" data-linenumber="84">
+ <span class="hits">108</span>
<code class="ruby"> return true if known_contentful_object?(fields[field_name])</code>
</li>
- <li class="covered" data-hits="126" data-linenumber="85">
- <span class="hits">126</span>
+ <li class="covered" data-hits="124" data-linenumber="85">
+ <span class="hits">124</span>
<code class="ruby"> fields[field_name].is_a?(Enumerable) && fields[field_name].any? { |object| known_contentful_object?(object) }</code>
</li>
<li class="never" data-hits="" data-linenumber="86">
@@ -7307,12 +7127,12 @@
<span class="hits">1</span>
<code class="ruby"> def known_contentful_object?(object)</code>
</li>
- <li class="covered" data-hits="154" data-linenumber="89">
- <span class="hits">154</span>
+ <li class="covered" data-hits="144" data-linenumber="89">
+ <span class="hits">144</span>
<code class="ruby"> (object.is_a?(Contentful::Entry) || object.is_a?(Contentful::Asset))</code>
</li>
<li class="never" data-hits="" data-linenumber="90">
@@ -7343,19 +7163,19 @@
<span class="hits">1</span>
<code class="ruby"> def repr_name</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="95">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="95">
+
<code class="ruby"> content_type_key = Support.snakify('contentType', @configuration[:use_camel_case]).to_sym</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="96">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="96">
+
<code class="ruby"> "#{super}[#{sys[content_type_key].id}]"</code>
</li>
<li class="never" data-hits="" data-linenumber="97">
@@ -7381,15 +7201,15 @@
<div class="source_table" id="98433a4cac96676bcf6b420f480c3d946ae0d0cb">
<div class="header">
<h3>lib/contentful/error.rb</h3>
- <h4><span class="green">98.92 %</span> covered</h4>
+ <h4><span class="red">68.82 %</span> covered</h4>
<div>
<b>93</b> relevant lines.
- <span class="green"><b>92</b> lines covered</span> and
- <span class="red"><b>1</b> lines missed.</span>
+ <span class="green"><b>64</b> lines covered</span> and
+ <span class="red"><b>29</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -7434,18 +7254,18 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(response)</code>
</li>
- <li class="covered" data-hits="65" data-linenumber="8">
- <span class="hits">65</span>
+ <li class="covered" data-hits="1" data-linenumber="8">
+ <span class="hits">1</span>
<code class="ruby"> @response = response</code>
</li>
- <li class="covered" data-hits="65" data-linenumber="9">
- <span class="hits">65</span>
+ <li class="covered" data-hits="1" data-linenumber="9">
+ <span class="hits">1</span>
<code class="ruby"> super best_available_message</code>
</li>
<li class="never" data-hits="" data-linenumber="10">
@@ -7476,12 +7296,12 @@
<span class="hits">1</span>
<code class="ruby"> def self.[](error_status_code)</code>
</li>
- <li class="covered" data-hits="66" data-linenumber="15">
- <span class="hits">66</span>
+ <li class="covered" data-hits="1" data-linenumber="15">
+ <span class="hits">1</span>
<code class="ruby"> errors = {</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -7542,12 +7362,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="66" data-linenumber="26">
- <span class="hits">66</span>
+ <li class="covered" data-hits="1" data-linenumber="26">
+ <span class="hits">1</span>
<code class="ruby"> errors.key?(error_status_code) ? errors[error_status_code] : Error</code>
</li>
<li class="never" data-hits="" data-linenumber="27">
@@ -7578,13 +7398,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="13" data-linenumber="32">
- <span class="hits">13</span>
+ <li class="missed" data-hits="0" data-linenumber="32">
+
<code class="ruby"> "The following error was received: #{@response.raw.body}"</code>
</li>
<li class="never" data-hits="" data-linenumber="33">
@@ -7602,13 +7422,13 @@
<span class="hits">1</span>
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="covered" data-hits="10" data-linenumber="36">
- <span class="hits">10</span>
+ <li class="missed" data-hits="0" data-linenumber="36">
+
<code class="ruby"> details.to_s</code>
</li>
<li class="never" data-hits="" data-linenumber="37">
@@ -7626,12 +7446,12 @@
<span class="hits">1</span>
<code class="ruby"> def additional_info?</code>
</li>
- <li class="covered" data-hits="59" data-linenumber="40">
- <span class="hits">59</span>
+ <li class="covered" data-hits="1" data-linenumber="40">
+ <span class="hits">1</span>
<code class="ruby"> false</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
@@ -7674,12 +7494,12 @@
<span class="hits">1</span>
<code class="ruby"> def best_available_message</code>
</li>
- <li class="covered" data-hits="65" data-linenumber="48">
- <span class="hits">65</span>
+ <li class="covered" data-hits="1" data-linenumber="48">
+ <span class="hits">1</span>
<code class="ruby"> error_message = [</code>
</li>
<li class="never" data-hits="" data-linenumber="49">
@@ -7698,73 +7518,73 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="65" data-linenumber="52">
- <span class="hits">65</span>
+ <li class="covered" data-hits="1" data-linenumber="52">
+ <span class="hits">1</span>
<code class="ruby"> begin</code>
</li>
- <li class="covered" data-hits="65" data-linenumber="53">
- <span class="hits">65</span>
+ <li class="covered" data-hits="1" data-linenumber="53">
+ <span class="hits">1</span>
<code class="ruby"> response_json = @response.load_json</code>
</li>
- <li class="covered" data-hits="61" data-linenumber="54">
- <span class="hits">61</span>
+ <li class="covered" data-hits="1" data-linenumber="54">
+ <span class="hits">1</span>
<code class="ruby"> message = response_json.fetch('message', default_error_message)</code>
</li>
- <li class="covered" data-hits="61" data-linenumber="55">
- <span class="hits">61</span>
+ <li class="covered" data-hits="1" data-linenumber="55">
+ <span class="hits">1</span>
<code class="ruby"> details = response_json.fetch('details', nil)</code>
</li>
- <li class="covered" data-hits="61" data-linenumber="56">
- <span class="hits">61</span>
+ <li class="covered" data-hits="1" data-linenumber="56">
+ <span class="hits">1</span>
<code class="ruby"> request_id = response_json.fetch('requestId', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="57">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="61" data-linenumber="58">
- <span class="hits">61</span>
+ <li class="covered" data-hits="1" data-linenumber="58">
+ <span class="hits">1</span>
<code class="ruby"> error_message << "Message: #{message}"</code>
</li>
- <li class="covered" data-hits="61" data-linenumber="59">
- <span class="hits">61</span>
+ <li class="covered" data-hits="1" data-linenumber="59">
+ <span class="hits">1</span>
<code class="ruby"> error_message << "Details: #{handle_details(details)}" if details</code>
</li>
- <li class="covered" data-hits="61" data-linenumber="60">
- <span class="hits">61</span>
+ <li class="covered" data-hits="1" data-linenumber="60">
+ <span class="hits">1</span>
<code class="ruby"> error_message << "Request ID: #{request_id}" if request_id</code>
</li>
<li class="never" data-hits="" data-linenumber="61">
<code class="ruby"> rescue</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="62">
- <span class="hits">4</span>
+ <li class="missed" data-hits="0" data-linenumber="62">
+
<code class="ruby"> error_message << "Message: #{default_error_message}"</code>
</li>
<li class="never" data-hits="" data-linenumber="63">
@@ -7776,24 +7596,24 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="65" data-linenumber="65">
- <span class="hits">65</span>
+ <li class="covered" data-hits="1" data-linenumber="65">
+ <span class="hits">1</span>
<code class="ruby"> error_message << additional_info if additional_info?</code>
</li>
<li class="never" data-hits="" data-linenumber="66">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="65" data-linenumber="67">
- <span class="hits">65</span>
+ <li class="covered" data-hits="1" data-linenumber="67">
+ <span class="hits">1</span>
<code class="ruby"> error_message.join("\n")</code>
</li>
<li class="never" data-hits="" data-linenumber="68">
@@ -7842,12 +7662,12 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="10" data-linenumber="76">
- <span class="hits">10</span>
+ <li class="covered" data-hits="1" data-linenumber="76">
+ <span class="hits">1</span>
<code class="ruby"> 'The request was malformed or missing a required parameter.'</code>
</li>
<li class="never" data-hits="" data-linenumber="77">
@@ -7866,37 +7686,37 @@
<span class="hits">1</span>
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="80">
- <span class="hits">7</span>
+ <li class="missed" data-hits="0" data-linenumber="80">
+
<code class="ruby"> return details if details.is_a?(String)</code>
</li>
<li class="never" data-hits="" data-linenumber="81">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="5" data-linenumber="82">
- <span class="hits">5</span>
+ <li class="missed" data-hits="0" data-linenumber="82">
+
<code class="ruby"> handle_detail = proc do |detail|</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="83">
- <span class="hits">5</span>
+ <li class="missed" data-hits="0" data-linenumber="83">
+
<code class="ruby"> return detail if detail.is_a?(String)</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="84">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="84">
+
<code class="ruby"> detail.fetch('details', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="85">
@@ -7908,19 +7728,19 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="10" data-linenumber="87">
- <span class="hits">10</span>
+ <li class="missed" data-hits="0" data-linenumber="87">
+
<code class="ruby"> inner_details = details['errors'].map { |detail| handle_detail[detail] }.reject(&:nil?)</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="88">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="88">
+
<code class="ruby"> inner_details.join("\n\t")</code>
</li>
<li class="never" data-hits="" data-linenumber="89">
@@ -7968,13 +7788,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="97">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="97">
+
<code class="ruby"> 'The authorization token was invalid.'</code>
</li>
<li class="never" data-hits="" data-linenumber="98">
@@ -8022,13 +7842,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="106">
- <span class="hits">4</span>
+ <li class="missed" data-hits="0" data-linenumber="106">
+
<code class="ruby"> 'The specified token does not have access to the requested resource.'</code>
</li>
<li class="never" data-hits="" data-linenumber="107">
@@ -8046,13 +7866,13 @@
<span class="hits">1</span>
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="110">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="110">
+
<code class="ruby"> "\n\tReasons:\n\t\t#{details['reasons'].join("\n\t\t")}"</code>
</li>
<li class="never" data-hits="" data-linenumber="111">
@@ -8100,13 +7920,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="17" data-linenumber="119">
- <span class="hits">17</span>
+ <li class="missed" data-hits="0" data-linenumber="119">
+
<code class="ruby"> 'The requested resource or endpoint could not be found.'</code>
</li>
<li class="never" data-hits="" data-linenumber="120">
@@ -8124,61 +7944,61 @@
<span class="hits">1</span>
<code class="ruby"> def handle_details(details)</code>
</li>
- <li class="covered" data-hits="12" data-linenumber="123">
- <span class="hits">12</span>
+ <li class="missed" data-hits="0" data-linenumber="123">
+
<code class="ruby"> return details if details.is_a?(String)</code>
</li>
<li class="never" data-hits="" data-linenumber="124">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="10" data-linenumber="125">
- <span class="hits">10</span>
+ <li class="missed" data-hits="0" data-linenumber="125">
+
<code class="ruby"> type = details['type'] || (details['sys'] || {})['type']</code>
</li>
- <li class="covered" data-hits="10" data-linenumber="126">
- <span class="hits">10</span>
+ <li class="missed" data-hits="0" data-linenumber="126">
+
<code class="ruby"> message = "The requested #{type} could not be found."</code>
</li>
<li class="never" data-hits="" data-linenumber="127">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="10" data-linenumber="128">
- <span class="hits">10</span>
+ <li class="missed" data-hits="0" data-linenumber="128">
+
<code class="ruby"> resource_id = details.fetch('id', nil)</code>
</li>
- <li class="covered" data-hits="10" data-linenumber="129">
- <span class="hits">10</span>
+ <li class="missed" data-hits="0" data-linenumber="129">
+
<code class="ruby"> message += " ID: #{resource_id}." if resource_id</code>
</li>
<li class="never" data-hits="" data-linenumber="130">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="10" data-linenumber="131">
- <span class="hits">10</span>
+ <li class="missed" data-hits="0" data-linenumber="131">
+
<code class="ruby"> message</code>
</li>
<li class="never" data-hits="" data-linenumber="132">
@@ -8238,13 +8058,13 @@
<code class="ruby"> # rubocop:disable Style/DoubleNegation</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="142">
- <span class="hits">6</span>
+ <li class="missed" data-hits="0" data-linenumber="142">
+
<code class="ruby"> !!reset_time</code>
</li>
<li class="never" data-hits="" data-linenumber="143">
@@ -8274,13 +8094,13 @@
<span class="hits">1</span>
<code class="ruby"> def reset_time</code>
</li>
- <li class="covered" data-hits="11" data-linenumber="148">
- <span class="hits">11</span>
+ <li class="missed" data-hits="0" data-linenumber="148">
+
<code class="ruby"> @reset_time ||= @response.raw[RATE_LIMIT_RESET_HEADER_KEY]</code>
</li>
<li class="never" data-hits="" data-linenumber="149">
@@ -8310,13 +8130,13 @@
<span class="hits">1</span>
<code class="ruby"> def additional_info?</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="154">
- <span class="hits">6</span>
+ <li class="missed" data-hits="0" data-linenumber="154">
+
<code class="ruby"> reset_time?</code>
</li>
<li class="never" data-hits="" data-linenumber="155">
@@ -8334,13 +8154,13 @@
<span class="hits">1</span>
<code class="ruby"> def additional_info</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="158">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="158">
+
<code class="ruby"> ["Time until reset (seconds): #{reset_time}"]</code>
</li>
<li class="never" data-hits="" data-linenumber="159">
@@ -8358,13 +8178,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="162">
- <span class="hits">6</span>
+ <li class="missed" data-hits="0" data-linenumber="162">
+
<code class="ruby"> 'Rate limit exceeded. Too many requests.'</code>
</li>
<li class="never" data-hits="" data-linenumber="163">
@@ -8412,13 +8232,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="171">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="171">
+
<code class="ruby"> 'Internal server error.'</code>
</li>
<li class="never" data-hits="" data-linenumber="172">
@@ -8466,13 +8286,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="180">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="180">
+
<code class="ruby"> 'The requested space is hibernated.'</code>
</li>
<li class="never" data-hits="" data-linenumber="181">
@@ -8520,13 +8340,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="189">
- <span class="hits">4</span>
+ <li class="missed" data-hits="0" data-linenumber="189">
+
<code class="ruby"> 'The request was malformed or missing a required parameter.'</code>
</li>
<li class="never" data-hits="" data-linenumber="190">
@@ -8574,13 +8394,13 @@
<span class="hits">1</span>
<code class="ruby"> def default_error_message</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="198">
- <span class="hits">4</span>
+ <li class="missed" data-hits="0" data-linenumber="198">
+
<code class="ruby"> @response.error_message</code>
</li>
<li class="never" data-hits="" data-linenumber="199">
@@ -8791,54 +8611,54 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(json)</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="27">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="27">
+ <span class="hits">79</span>
<code class="ruby"> @raw = json</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="28">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="28">
+ <span class="hits">79</span>
<code class="ruby"> @id = json.fetch('id', nil)</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="29">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="29">
+ <span class="hits">79</span>
<code class="ruby"> @name = json.fetch('name', nil)</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="30">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="30">
+ <span class="hits">79</span>
<code class="ruby"> @type = json.fetch('type', nil)</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="31">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="31">
+ <span class="hits">79</span>
<code class="ruby"> @link_type = json.fetch('linkType', nil)</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="32">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="32">
+ <span class="hits">79</span>
<code class="ruby"> @items = json.key?('items') ? Field.new(json.fetch('items', {})) : nil</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="33">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="33">
+ <span class="hits">79</span>
<code class="ruby"> @required = json.fetch('required', false)</code>
</li>
- <li class="covered" data-hits="642" data-linenumber="34">
- <span class="hits">642</span>
+ <li class="covered" data-hits="79" data-linenumber="34">
+ <span class="hits">79</span>
<code class="ruby"> @localized = json.fetch('localized', false)</code>
</li>
<li class="never" data-hits="" data-linenumber="35">
@@ -8863,42 +8683,42 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(value, configuration)</code>
</li>
- <li class="covered" data-hits="5432" data-linenumber="39">
- <span class="hits">5432</span>
+ <li class="covered" data-hits="41" data-linenumber="39">
+ <span class="hits">41</span>
<code class="ruby"> return value if type.nil?</code>
</li>
- <li class="covered" data-hits="5432" data-linenumber="40">
- <span class="hits">5432</span>
+ <li class="covered" data-hits="41" data-linenumber="40">
+ <span class="hits">41</span>
<code class="ruby"> return value if value.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="5425" data-linenumber="42">
- <span class="hits">5425</span>
+ <li class="covered" data-hits="41" data-linenumber="42">
+ <span class="hits">41</span>
<code class="ruby"> options = {}</code>
</li>
- <li class="covered" data-hits="5425" data-linenumber="43">
- <span class="hits">5425</span>
+ <li class="covered" data-hits="41" data-linenumber="43">
+ <span class="hits">41</span>
<code class="ruby"> options[:coercion_class] = KNOWN_TYPES[items.type] unless items.nil?</code>
</li>
- <li class="covered" data-hits="5425" data-linenumber="44">
- <span class="hits">5425</span>
+ <li class="covered" data-hits="41" data-linenumber="44">
+ <span class="hits">41</span>
<code class="ruby"> KNOWN_TYPES[type].new(value, options).coerce(configuration)</code>
</li>
<li class="never" data-hits="" data-linenumber="45">
@@ -8996,36 +8816,36 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(item, _configuration, localized = false, includes = [], entries = {}, depth = 0, errors = [])</code>
</li>
- <li class="covered" data-hits="3135" data-linenumber="11">
- <span class="hits">3135</span>
+ <li class="covered" data-hits="1046" data-linenumber="11">
+ <span class="hits">1046</span>
<code class="ruby"> super</code>
</li>
<li class="never" data-hits="" data-linenumber="12">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3135" data-linenumber="13">
- <span class="hits">3135</span>
+ <li class="covered" data-hits="1046" data-linenumber="13">
+ <span class="hits">1046</span>
<code class="ruby"> @localized = localized</code>
</li>
- <li class="covered" data-hits="3135" data-linenumber="14">
- <span class="hits">3135</span>
+ <li class="covered" data-hits="1046" data-linenumber="14">
+ <span class="hits">1046</span>
<code class="ruby"> @fields = hydrate_fields(includes, entries, errors)</code>
</li>
- <li class="covered" data-hits="3135" data-linenumber="15">
- <span class="hits">3135</span>
+ <li class="covered" data-hits="1046" data-linenumber="15">
+ <span class="hits">1046</span>
<code class="ruby"> define_fields_methods!</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -9062,18 +8882,18 @@
<span class="hits">1</span>
<code class="ruby"> def fields(wanted_locale = nil)</code>
</li>
- <li class="covered" data-hits="3518" data-linenumber="22">
- <span class="hits">3518</span>
+ <li class="covered" data-hits="1350" data-linenumber="22">
+ <span class="hits">1350</span>
<code class="ruby"> wanted_locale = internal_resource_locale if wanted_locale.nil?</code>
</li>
- <li class="covered" data-hits="3518" data-linenumber="23">
- <span class="hits">3518</span>
+ <li class="covered" data-hits="1350" data-linenumber="23">
+ <span class="hits">1350</span>
<code class="ruby"> @fields.fetch(wanted_locale.to_s, {})</code>
</li>
<li class="never" data-hits="" data-linenumber="24">
@@ -9188,12 +9008,12 @@
<span class="hits">1</span>
<code class="ruby"> def locales</code>
</li>
- <li class="covered" data-hits="743" data-linenumber="43">
- <span class="hits">743</span>
+ <li class="covered" data-hits="52" data-linenumber="43">
+ <span class="hits">52</span>
<code class="ruby"> @fields.keys</code>
</li>
<li class="never" data-hits="" data-linenumber="44">
@@ -9218,12 +9038,12 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_dump</code>
</li>
- <li class="covered" data-hits="26" data-linenumber="48">
- <span class="hits">26</span>
+ <li class="covered" data-hits="21" data-linenumber="48">
+ <span class="hits">21</span>
<code class="ruby"> {</code>
</li>
<li class="never" data-hits="" data-linenumber="49">
@@ -9272,30 +9092,30 @@
<span class="hits">1</span>
<code class="ruby"> def marshal_load(raw_object)</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="57">
- <span class="hits">45</span>
+ <li class="covered" data-hits="31" data-linenumber="57">
+ <span class="hits">31</span>
<code class="ruby"> super(raw_object)</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="58">
- <span class="hits">45</span>
+ <li class="covered" data-hits="31" data-linenumber="58">
+ <span class="hits">31</span>
<code class="ruby"> @localized = raw_object[:localized]</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="59">
- <span class="hits">45</span>
+ <li class="covered" data-hits="31" data-linenumber="59">
+ <span class="hits">31</span>
<code class="ruby"> @fields = hydrate_fields(raw_object[:configuration].fetch(:includes_for_single, []), {}, [])</code>
</li>
- <li class="covered" data-hits="45" data-linenumber="60">
- <span class="hits">45</span>
+ <li class="covered" data-hits="31" data-linenumber="60">
+ <span class="hits">31</span>
<code class="ruby"> define_fields_methods!</code>
</li>
<li class="never" data-hits="" data-linenumber="61">
@@ -9320,36 +9140,36 @@
<span class="hits">1</span>
<code class="ruby"> def raw_with_links</code>
</li>
- <li class="covered" data-hits="143" data-linenumber="65">
- <span class="hits">143</span>
+ <li class="covered" data-hits="129" data-linenumber="65">
+ <span class="hits">129</span>
<code class="ruby"> links = fields.keys.select { |property| known_link?(property) }</code>
</li>
- <li class="covered" data-hits="26" data-linenumber="66">
- <span class="hits">26</span>
+ <li class="covered" data-hits="21" data-linenumber="66">
+ <span class="hits">21</span>
<code class="ruby"> processed_raw = raw.clone</code>
</li>
- <li class="covered" data-hits="26" data-linenumber="67">
- <span class="hits">26</span>
+ <li class="covered" data-hits="21" data-linenumber="67">
+ <span class="hits">21</span>
<code class="ruby"> raw['fields'].each do |k, v|</code>
</li>
- <li class="covered" data-hits="131" data-linenumber="68">
- <span class="hits">131</span>
+ <li class="covered" data-hits="122" data-linenumber="68">
+ <span class="hits">122</span>
<code class="ruby"> links_key = Support.snakify(k, @configuration[:use_camel_case])</code>
</li>
- <li class="covered" data-hits="131" data-linenumber="69">
- <span class="hits">131</span>
+ <li class="covered" data-hits="122" data-linenumber="69">
+ <span class="hits">122</span>
<code class="ruby"> processed_raw['fields'][k] = links.include?(links_key.to_sym) ? send(links_key) : v</code>
</li>
<li class="never" data-hits="" data-linenumber="70">
@@ -9362,12 +9182,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="26" data-linenumber="72">
- <span class="hits">26</span>
+ <li class="covered" data-hits="21" data-linenumber="72">
+ <span class="hits">21</span>
<code class="ruby"> processed_raw</code>
</li>
<li class="never" data-hits="" data-linenumber="73">
@@ -9398,24 +9218,24 @@
<span class="hits">1</span>
<code class="ruby"> def define_fields_methods!</code>
</li>
- <li class="covered" data-hits="3180" data-linenumber="78">
- <span class="hits">3180</span>
+ <li class="covered" data-hits="1077" data-linenumber="78">
+ <span class="hits">1077</span>
<code class="ruby"> fields.each do |k, v|</code>
</li>
- <li class="covered" data-hits="13533" data-linenumber="79">
- <span class="hits">13533</span>
+ <li class="covered" data-hits="4683" data-linenumber="79">
+ <span class="hits">4683</span>
<code class="ruby"> define_singleton_method k do</code>
</li>
- <li class="covered" data-hits="277" data-linenumber="80">
- <span class="hits">277</span>
+ <li class="covered" data-hits="261" data-linenumber="80">
+ <span class="hits">261</span>
<code class="ruby"> v</code>
</li>
<li class="never" data-hits="" data-linenumber="81">
@@ -9446,48 +9266,48 @@
<span class="hits">1</span>
<code class="ruby"> def hydrate_localized_fields(includes, errors, entries)</code>
</li>
- <li class="covered" data-hits="1562" data-linenumber="86">
- <span class="hits">1562</span>
+ <li class="covered" data-hits="94" data-linenumber="86">
+ <span class="hits">94</span>
<code class="ruby"> locale = internal_resource_locale</code>
</li>
- <li class="covered" data-hits="1562" data-linenumber="87">
- <span class="hits">1562</span>
+ <li class="covered" data-hits="94" data-linenumber="87">
+ <span class="hits">94</span>
<code class="ruby"> result = { locale => {} }</code>
</li>
- <li class="covered" data-hits="1562" data-linenumber="88">
- <span class="hits">1562</span>
+ <li class="covered" data-hits="94" data-linenumber="88">
+ <span class="hits">94</span>
<code class="ruby"> raw['fields'].each do |name, locales|</code>
</li>
- <li class="covered" data-hits="6614" data-linenumber="89">
- <span class="hits">6614</span>
+ <li class="covered" data-hits="393" data-linenumber="89">
+ <span class="hits">393</span>
<code class="ruby"> locales.each do |loc, value|</code>
</li>
- <li class="covered" data-hits="7295" data-linenumber="90">
- <span class="hits">7295</span>
+ <li class="covered" data-hits="441" data-linenumber="90">
+ <span class="hits">441</span>
<code class="ruby"> result[loc] ||= {}</code>
</li>
- <li class="covered" data-hits="7295" data-linenumber="91">
- <span class="hits">7295</span>
+ <li class="covered" data-hits="441" data-linenumber="91">
+ <span class="hits">441</span>
<code class="ruby"> name = Support.snakify(name, @configuration[:use_camel_case])</code>
</li>
- <li class="covered" data-hits="7295" data-linenumber="92">
- <span class="hits">7295</span>
+ <li class="covered" data-hits="441" data-linenumber="92">
+ <span class="hits">441</span>
<code class="ruby"> result[loc][name.to_sym] = coerce(</code>
</li>
<li class="never" data-hits="" data-linenumber="93">
@@ -9542,12 +9362,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1562" data-linenumber="102">
- <span class="hits">1562</span>
+ <li class="covered" data-hits="94" data-linenumber="102">
+ <span class="hits">94</span>
<code class="ruby"> result</code>
</li>
<li class="never" data-hits="" data-linenumber="103">
@@ -9566,36 +9386,36 @@
<span class="hits">1</span>
<code class="ruby"> def hydrate_nonlocalized_fields(includes, errors, entries)</code>
</li>
- <li class="covered" data-hits="1611" data-linenumber="106">
- <span class="hits">1611</span>
+ <li class="covered" data-hits="981" data-linenumber="106">
+ <span class="hits">981</span>
<code class="ruby"> result = { locale => {} }</code>
</li>
- <li class="covered" data-hits="1611" data-linenumber="107">
- <span class="hits">1611</span>
+ <li class="covered" data-hits="981" data-linenumber="107">
+ <span class="hits">981</span>
<code class="ruby"> locale = internal_resource_locale</code>
</li>
- <li class="covered" data-hits="1611" data-linenumber="108">
- <span class="hits">1611</span>
+ <li class="covered" data-hits="981" data-linenumber="108">
+ <span class="hits">981</span>
<code class="ruby"> raw['fields'].each do |name, value|</code>
</li>
- <li class="covered" data-hits="6934" data-linenumber="109">
- <span class="hits">6934</span>
+ <li class="covered" data-hits="4290" data-linenumber="109">
+ <span class="hits">4290</span>
<code class="ruby"> name = Support.snakify(name, @configuration[:use_camel_case])</code>
</li>
- <li class="covered" data-hits="6934" data-linenumber="110">
- <span class="hits">6934</span>
+ <li class="covered" data-hits="4290" data-linenumber="110">
+ <span class="hits">4290</span>
<code class="ruby"> result[locale][name.to_sym] = coerce(</code>
</li>
<li class="never" data-hits="" data-linenumber="111">
@@ -9644,12 +9464,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1611" data-linenumber="119">
- <span class="hits">1611</span>
+ <li class="covered" data-hits="981" data-linenumber="119">
+ <span class="hits">981</span>
<code class="ruby"> result</code>
</li>
<li class="never" data-hits="" data-linenumber="120">
@@ -9668,42 +9488,42 @@
<span class="hits">1</span>
<code class="ruby"> def hydrate_fields(includes, entries, errors)</code>
</li>
- <li class="covered" data-hits="3180" data-linenumber="123">
- <span class="hits">3180</span>
+ <li class="covered" data-hits="1077" data-linenumber="123">
+ <span class="hits">1077</span>
<code class="ruby"> return {} unless raw.key?('fields')</code>
</li>
<li class="never" data-hits="" data-linenumber="124">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3173" data-linenumber="125">
- <span class="hits">3173</span>
+ <li class="covered" data-hits="1075" data-linenumber="125">
+ <span class="hits">1075</span>
<code class="ruby"> if localized</code>
</li>
- <li class="covered" data-hits="1562" data-linenumber="126">
- <span class="hits">1562</span>
+ <li class="covered" data-hits="94" data-linenumber="126">
+ <span class="hits">94</span>
<code class="ruby"> hydrate_localized_fields(includes, errors, entries)</code>
</li>
<li class="never" data-hits="" data-linenumber="127">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="1611" data-linenumber="128">
- <span class="hits">1611</span>
+ <li class="covered" data-hits="981" data-linenumber="128">
+ <span class="hits">981</span>
<code class="ruby"> hydrate_nonlocalized_fields(includes, errors, entries)</code>
</li>
<li class="never" data-hits="" data-linenumber="129">
@@ -9740,12 +9560,12 @@
<span class="hits">1</span>
<code class="ruby"> def coerce(_field_id, value, _includes, _errors, _entries)</code>
</li>
- <li class="covered" data-hits="5857" data-linenumber="135">
- <span class="hits">5857</span>
+ <li class="covered" data-hits="3638" data-linenumber="135">
+ <span class="hits">3638</span>
<code class="ruby"> value</code>
</li>
<li class="never" data-hits="" data-linenumber="136">
@@ -9807,24 +9627,24 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(json, configuration)</code>
</li>
- <li class="covered" data-hits="1498" data-linenumber="5">
- <span class="hits">1498</span>
+ <li class="covered" data-hits="494" data-linenumber="5">
+ <span class="hits">494</span>
<code class="ruby"> @configuration = configuration</code>
</li>
<li class="never" data-hits="" data-linenumber="6">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1498" data-linenumber="7">
- <span class="hits">1498</span>
+ <li class="covered" data-hits="494" data-linenumber="7">
+ <span class="hits">494</span>
<code class="ruby"> define_fields!(json)</code>
</li>
<li class="never" data-hits="" data-linenumber="8">
@@ -9855,24 +9675,24 @@
<span class="hits">1</span>
<code class="ruby"> def define_fields!(json)</code>
</li>
- <li class="covered" data-hits="1498" data-linenumber="13">
- <span class="hits">1498</span>
+ <li class="covered" data-hits="494" data-linenumber="13">
+ <span class="hits">494</span>
<code class="ruby"> json.each do |k, v|</code>
</li>
- <li class="covered" data-hits="5992" data-linenumber="14">
- <span class="hits">5992</span>
+ <li class="covered" data-hits="1976" data-linenumber="14">
+ <span class="hits">1976</span>
<code class="ruby"> define_singleton_method Support.snakify(k, @configuration[:use_camel_case]) do</code>
</li>
- <li class="covered" data-hits="40" data-linenumber="15">
- <span class="hits">40</span>
+ <li class="covered" data-hits="6" data-linenumber="15">
+ <span class="hits">6</span>
<code class="ruby"> v</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -9911,15 +9731,15 @@
<div class="source_table" id="f0b3585d50697809ca059b22b439d1c92b144124">
<div class="header">
<h3>lib/contentful/link.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="red">66.67 %</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>
+ <span class="green"><b>4</b> lines covered</span> and
+ <span class="red"><b>2</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -9976,19 +9796,19 @@
<span class="hits">1</span>
<code class="ruby"> def resolve(client, query = {})</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="10">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="10">
+
<code class="ruby"> id_and_query = [(id unless link_type == 'Space')].compact + [query]</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="11">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="11">
+
<code class="ruby"> client.public_send(</code>
</li>
<li class="never" data-hits="" data-linenumber="12">
@@ -10032,15 +9852,15 @@
<div class="source_table" id="ce8ecf27b5e97b41247b7386680ee9aa0e670574">
<div class="header">
<h3>lib/contentful/locale.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="red">55.56 %</span> covered</h4>
<div>
<b>9</b> relevant lines.
- <span class="green"><b>9</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>5</b> lines covered</span> and
+ <span class="red"><b>4</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -10097,31 +9917,31 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(item, *)</code>
</li>
- <li class="covered" data-hits="21" data-linenumber="10">
- <span class="hits">21</span>
+ <li class="missed" data-hits="0" data-linenumber="10">
+
<code class="ruby"> @code = item.fetch('code', nil)</code>
</li>
- <li class="covered" data-hits="21" data-linenumber="11">
- <span class="hits">21</span>
+ <li class="missed" data-hits="0" data-linenumber="11">
+
<code class="ruby"> @name = item.fetch('name', nil)</code>
</li>
- <li class="covered" data-hits="21" data-linenumber="12">
- <span class="hits">21</span>
+ <li class="missed" data-hits="0" data-linenumber="12">
+
<code class="ruby"> @default = item.fetch('default', false)</code>
</li>
- <li class="covered" data-hits="21" data-linenumber="13">
- <span class="hits">21</span>
+ <li class="missed" data-hits="0" data-linenumber="13">
+
<code class="ruby"> @fallback_code = item.fetch('fallbackCode', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="14">
@@ -10147,15 +9967,15 @@
<div class="source_table" id="0b0fac99f5d491e120b04db5fad4d156a78fc99e">
<div class="header">
<h3>lib/contentful/location.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="red">75.0 %</span> covered</h4>
<div>
<b>8</b> relevant lines.
- <span class="green"><b>8</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>6</b> lines covered</span> and
+ <span class="red"><b>2</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -10212,19 +10032,19 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(json)</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="10">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="10">
+
<code class="ruby"> @lat = json.fetch('lat', nil)</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="11">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="11">
+
<code class="ruby"> @lon = json.fetch('lon', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="12">
@@ -10250,15 +10070,15 @@
<div class="source_table" id="283a9b245e7a50ed1ed0ff2acf5bf3df054a6b05">
<div class="header">
<h3>lib/contentful/request.rb</h3>
- <h4><span class="green">96.0 %</span> covered</h4>
+ <h4><span class="yellow">88.0 %</span> covered</h4>
<div>
<b>25</b> relevant lines.
- <span class="green"><b>24</b> lines covered</span> and
- <span class="red"><b>1</b> lines missed.</span>
+ <span class="green"><b>22</b> lines covered</span> and
+ <span class="red"><b>3</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -10309,72 +10129,72 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(client, endpoint, query = {}, id = nil)</code>
</li>
- <li class="covered" data-hits="227" data-linenumber="9">
- <span class="hits">227</span>
+ <li class="covered" data-hits="58" data-linenumber="9">
+ <span class="hits">58</span>
<code class="ruby"> @client = client</code>
</li>
- <li class="covered" data-hits="227" data-linenumber="10">
- <span class="hits">227</span>
+ <li class="covered" data-hits="58" data-linenumber="10">
+ <span class="hits">58</span>
<code class="ruby"> @endpoint = endpoint</code>
</li>
<li class="never" data-hits="" data-linenumber="11">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="227" data-linenumber="12">
- <span class="hits">227</span>
+ <li class="covered" data-hits="58" data-linenumber="12">
+ <span class="hits">58</span>
<code class="ruby"> @query = (normalize_query(query) if query && !query.empty?)</code>
</li>
<li class="never" data-hits="" data-linenumber="13">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="227" data-linenumber="14">
- <span class="hits">227</span>
+ <li class="covered" data-hits="58" data-linenumber="14">
+ <span class="hits">58</span>
<code class="ruby"> if id</code>
</li>
- <li class="covered" data-hits="61" data-linenumber="15">
- <span class="hits">61</span>
+ <li class="missed" data-hits="0" data-linenumber="15">
+
<code class="ruby"> @type = :single</code>
</li>
- <li class="covered" data-hits="61" data-linenumber="16">
- <span class="hits">61</span>
+ <li class="missed" data-hits="0" data-linenumber="16">
+
<code class="ruby"> @id = URI.escape(id)</code>
</li>
<li class="never" data-hits="" data-linenumber="17">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="166" data-linenumber="18">
- <span class="hits">166</span>
+ <li class="covered" data-hits="58" data-linenumber="18">
+ <span class="hits">58</span>
<code class="ruby"> @type = :multi</code>
</li>
- <li class="covered" data-hits="166" data-linenumber="19">
- <span class="hits">166</span>
+ <li class="covered" data-hits="58" data-linenumber="19">
+ <span class="hits">58</span>
<code class="ruby"> @id = nil</code>
</li>
<li class="never" data-hits="" data-linenumber="20">
@@ -10405,12 +10225,12 @@
<span class="hits">1</span>
<code class="ruby"> def url</code>
</li>
- <li class="covered" data-hits="220" data-linenumber="25">
- <span class="hits">220</span>
+ <li class="covered" data-hits="58" data-linenumber="25">
+ <span class="hits">58</span>
<code class="ruby"> "#{@endpoint}#{@type == :single ? "/#{id}" : ''}"</code>
</li>
<li class="never" data-hits="" data-linenumber="26">
@@ -10435,12 +10255,12 @@
<span class="hits">1</span>
<code class="ruby"> def get</code>
</li>
- <li class="covered" data-hits="207" data-linenumber="30">
- <span class="hits">207</span>
+ <li class="covered" data-hits="58" data-linenumber="30">
+ <span class="hits">58</span>
<code class="ruby"> client.get(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="31">
@@ -10465,12 +10285,12 @@
<span class="hits">1</span>
<code class="ruby"> def absolute?</code>
</li>
- <li class="covered" data-hits="215" data-linenumber="35">
- <span class="hits">215</span>
+ <li class="covered" data-hits="58" data-linenumber="35">
+ <span class="hits">58</span>
<code class="ruby"> @endpoint.start_with?('http')</code>
</li>
<li class="never" data-hits="" data-linenumber="36">
@@ -10531,36 +10351,36 @@
<span class="hits">1</span>
<code class="ruby"> def normalize_query(query)</code>
</li>
- <li class="covered" data-hits="118" data-linenumber="46">
- <span class="hits">118</span>
+ <li class="covered" data-hits="54" data-linenumber="46">
+ <span class="hits">54</span>
<code class="ruby"> Hash[</code>
</li>
<li class="never" data-hits="" data-linenumber="47">
<code class="ruby"> query.map do |key, value|</code>
</li>
- <li class="covered" data-hits="156" data-linenumber="48">
- <span class="hits">156</span>
+ <li class="covered" data-hits="75" data-linenumber="48">
+ <span class="hits">75</span>
<code class="ruby"> [</code>
</li>
<li class="never" data-hits="" data-linenumber="49">
<code class="ruby"> key.to_sym,</code>
</li>
- <li class="covered" data-hits="156" data-linenumber="50">
- <span class="hits">156</span>
+ <li class="covered" data-hits="75" data-linenumber="50">
+ <span class="hits">75</span>
<code class="ruby"> value.is_a?(::Array) ? value.join(',') : value</code>
</li>
<li class="never" data-hits="" data-linenumber="51">
@@ -10605,15 +10425,15 @@
<div class="source_table" id="ea1894a682921dc1a4b4d4255935538a0067cdfd">
<div class="header">
<h3>lib/contentful/resource_builder.rb</h3>
- <h4><span class="green">96.74 %</span> covered</h4>
+ <h4><span class="green">94.57 %</span> covered</h4>
<div>
<b>92</b> relevant lines.
- <span class="green"><b>89</b> lines covered</span> and
- <span class="red"><b>3</b> lines missed.</span>
+ <span class="green"><b>87</b> lines covered</span> and
+ <span class="red"><b>5</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -10826,72 +10646,72 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(json, configuration = {}, localized = false, depth = 0, errors = [])</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="36">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="36">
+ <span class="hits">1059</span>
<code class="ruby"> @json = json</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="37">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="37">
+ <span class="hits">1059</span>
<code class="ruby"> @default_locale = configuration.fetch(:default_locale, ::Contentful::Client::DEFAULT_CONFIGURATION[:default_locale])</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="38">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="38">
+ <span class="hits">1059</span>
<code class="ruby"> @resource_mapping = default_resource_mapping.merge(configuration.fetch(:resource_mapping, {}))</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="39">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="39">
+ <span class="hits">1059</span>
<code class="ruby"> @entry_mapping = default_entry_mapping.merge(configuration.fetch(:entry_mapping, {}))</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="40">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="40">
+ <span class="hits">1059</span>
<code class="ruby"> @includes_for_single = configuration.fetch(:includes_for_single, [])</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="41">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="41">
+ <span class="hits">1059</span>
<code class="ruby"> @localized = localized</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="42">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="42">
+ <span class="hits">1059</span>
<code class="ruby"> @depth = depth</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="43">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="43">
+ <span class="hits">1059</span>
<code class="ruby"> @endpoint = configuration.fetch(:endpoint, nil)</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="44">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="44">
+ <span class="hits">1059</span>
<code class="ruby"> @configuration = configuration</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="45">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="45">
+ <span class="hits">1059</span>
<code class="ruby"> @resource_cache = configuration[:_entries_cache] || {}</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="46">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="46">
+ <span class="hits">1059</span>
<code class="ruby"> @errors = errors</code>
</li>
<li class="never" data-hits="" data-linenumber="47">
@@ -10928,18 +10748,18 @@
<span class="hits">1</span>
<code class="ruby"> def run</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="53">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="53">
+ <span class="hits">1059</span>
<code class="ruby"> return build_array if array?</code>
</li>
- <li class="covered" data-hits="2867" data-linenumber="54">
- <span class="hits">2867</span>
+ <li class="covered" data-hits="1003" data-linenumber="54">
+ <span class="hits">1003</span>
<code class="ruby"> build_single</code>
</li>
<li class="never" data-hits="" data-linenumber="55">
@@ -10982,60 +10802,60 @@
<span class="hits">1</span>
<code class="ruby"> def build_array</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="62">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="62">
+ <span class="hits">56</span>
<code class="ruby"> includes = fetch_includes || @includes_for_single</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="63">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="63">
+ <span class="hits">56</span>
<code class="ruby"> errors = fetch_errors || @errors</code>
</li>
<li class="never" data-hits="" data-linenumber="64">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="144" data-linenumber="65">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="65">
+ <span class="hits">56</span>
<code class="ruby"> result = json['items'].map do |item|</code>
</li>
- <li class="covered" data-hits="439" data-linenumber="66">
- <span class="hits">439</span>
+ <li class="covered" data-hits="72" data-linenumber="66">
+ <span class="hits">72</span>
<code class="ruby"> next if Support.unresolvable?(item, errors)</code>
</li>
- <li class="covered" data-hits="439" data-linenumber="67">
- <span class="hits">439</span>
+ <li class="covered" data-hits="72" data-linenumber="67">
+ <span class="hits">72</span>
<code class="ruby"> build_item(item, includes, errors)</code>
</li>
<li class="never" data-hits="" data-linenumber="68">
<code class="ruby"> end</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="69">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="69">
+ <span class="hits">56</span>
<code class="ruby"> array_class = fetch_array_class</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="70">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="70">
+ <span class="hits">56</span>
<code class="ruby"> array_class.new(json.dup.merge('items' => result), @configuration, endpoint)</code>
</li>
<li class="never" data-hits="" data-linenumber="71">
@@ -11054,24 +10874,24 @@
<span class="hits">1</span>
<code class="ruby"> def build_single</code>
</li>
- <li class="covered" data-hits="2867" data-linenumber="74">
- <span class="hits">2867</span>
+ <li class="covered" data-hits="1003" data-linenumber="74">
+ <span class="hits">1003</span>
<code class="ruby"> return if Support.unresolvable?(json, @errors)</code>
</li>
- <li class="covered" data-hits="2867" data-linenumber="75">
- <span class="hits">2867</span>
+ <li class="covered" data-hits="1003" data-linenumber="75">
+ <span class="hits">1003</span>
<code class="ruby"> includes = @includes_for_single</code>
</li>
- <li class="covered" data-hits="2867" data-linenumber="76">
- <span class="hits">2867</span>
+ <li class="covered" data-hits="1003" data-linenumber="76">
+ <span class="hits">1003</span>
<code class="ruby"> build_item(json, includes, @errors)</code>
</li>
<li class="never" data-hits="" data-linenumber="77">
@@ -11090,66 +10910,66 @@
<span class="hits">1</span>
<code class="ruby"> def build_item(item, includes = [], errors = [])</code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="80">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="80">
+ <span class="hits">1075</span>
<code class="ruby"> buildables = %w[Entry Asset ContentType Space DeletedEntry DeletedAsset Locale]</code>
</li>
- <li class="covered" data-hits="8573" data-linenumber="81">
- <span class="hits">8573</span>
+ <li class="covered" data-hits="2687" data-linenumber="81">
+ <span class="hits">2687</span>
<code class="ruby"> item_type = buildables.detect { |b| b.to_s == item['sys']['type'] }</code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="82">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="82">
+ <span class="hits">1075</span>
<code class="ruby"> fail UnparsableResource, 'Item type is not known, could not parse' if item_type.nil?</code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="83">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="83">
+ <span class="hits">1075</span>
<code class="ruby"> item_class = resource_class(item)</code>
</li>
<li class="never" data-hits="" data-linenumber="84">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="85">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="85">
+ <span class="hits">1075</span>
<code class="ruby"> reuse_entries = @configuration.fetch(:reuse_entries, false)</code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="86">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="86">
+ <span class="hits">1075</span>
<code class="ruby"> resource_cache = @resource_cache ? @resource_cache : {}</code>
</li>
<li class="never" data-hits="" data-linenumber="87">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="88">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="88">
+ <span class="hits">1075</span>
<code class="ruby"> id = "#{item['sys']['type']}:#{item['sys']['id']}"</code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="89">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="89">
+ <span class="hits">1075</span>
<code class="ruby"> resource = if reuse_entries && resource_cache.key?(id)</code>
</li>
<li class="covered" data-hits="2" data-linenumber="90">
@@ -11162,12 +10982,12 @@
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="3304" data-linenumber="92">
- <span class="hits">3304</span>
+ <li class="covered" data-hits="1073" data-linenumber="92">
+ <span class="hits">1073</span>
<code class="ruby"> item_class.new(item, @configuration, localized?, includes, resource_cache, depth, errors)</code>
</li>
<li class="never" data-hits="" data-linenumber="93">
@@ -11180,12 +11000,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="95">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="95">
+ <span class="hits">1075</span>
<code class="ruby"> resource</code>
</li>
<li class="never" data-hits="" data-linenumber="96">
@@ -11204,12 +11024,12 @@
<span class="hits">1</span>
<code class="ruby"> def fetch_includes</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="99">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="99">
+ <span class="hits">56</span>
<code class="ruby"> Support.includes_from_response(json)</code>
</li>
<li class="never" data-hits="" data-linenumber="100">
@@ -11228,12 +11048,12 @@
<span class="hits">1</span>
<code class="ruby"> def fetch_errors</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="103">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="103">
+ <span class="hits">56</span>
<code class="ruby"> json.fetch('errors', [])</code>
</li>
<li class="never" data-hits="" data-linenumber="104">
@@ -11252,18 +11072,18 @@
<span class="hits">1</span>
<code class="ruby"> def resource_class(item)</code>
</li>
- <li class="covered" data-hits="3306" data-linenumber="107">
- <span class="hits">3306</span>
+ <li class="covered" data-hits="1075" data-linenumber="107">
+ <span class="hits">1075</span>
<code class="ruby"> return fetch_custom_resource_class(item) if %w[Entry DeletedEntry Asset DeletedAsset].include?(item['sys']['type'])</code>
</li>
- <li class="covered" data-hits="127" data-linenumber="108">
- <span class="hits">127</span>
+ <li class="covered" data-hits="27" data-linenumber="108">
+ <span class="hits">27</span>
<code class="ruby"> resource_mapping[item['sys']['type']]</code>
</li>
<li class="never" data-hits="" data-linenumber="109">
@@ -11282,79 +11102,79 @@
<span class="hits">1</span>
<code class="ruby"> def fetch_custom_resource_class(item)</code>
</li>
- <li class="covered" data-hits="3179" data-linenumber="112">
- <span class="hits">3179</span>
+ <li class="covered" data-hits="1048" data-linenumber="112">
+ <span class="hits">1048</span>
<code class="ruby"> case item['sys']['type']</code>
</li>
<li class="never" data-hits="" data-linenumber="113">
<code class="ruby"> when 'Entry'</code>
</li>
- <li class="covered" data-hits="1655" data-linenumber="114">
- <span class="hits">1655</span>
+ <li class="covered" data-hits="565" data-linenumber="114">
+ <span class="hits">565</span>
<code class="ruby"> resource_class = entry_mapping[item['sys']['contentType']['sys']['id']]</code>
</li>
- <li class="covered" data-hits="1655" data-linenumber="115">
- <span class="hits">1655</span>
+ <li class="covered" data-hits="565" data-linenumber="115">
+ <span class="hits">565</span>
<code class="ruby"> return resource_class unless resource_class.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="116">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="1632" data-linenumber="117">
- <span class="hits">1632</span>
+ <li class="covered" data-hits="565" data-linenumber="117">
+ <span class="hits">565</span>
<code class="ruby"> fetch_custom_resource_mapping(item, 'Entry', Entry)</code>
</li>
<li class="never" data-hits="" data-linenumber="118">
<code class="ruby"> when 'Asset'</code>
</li>
- <li class="covered" data-hits="1482" data-linenumber="119">
- <span class="hits">1482</span>
+ <li class="covered" data-hits="483" data-linenumber="119">
+ <span class="hits">483</span>
<code class="ruby"> fetch_custom_resource_mapping(item, 'Asset', Asset)</code>
</li>
<li class="never" data-hits="" data-linenumber="120">
<code class="ruby"> when 'DeletedEntry'</code>
</li>
- <li class="covered" data-hits="6" data-linenumber="121">
- <span class="hits">6</span>
+ <li class="missed" data-hits="0" data-linenumber="121">
+
<code class="ruby"> fetch_custom_resource_mapping(item, 'DeletedEntry', DeletedEntry)</code>
</li>
<li class="never" data-hits="" data-linenumber="122">
<code class="ruby"> when 'DeletedAsset'</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="123">
- <span class="hits">36</span>
+ <li class="missed" data-hits="0" data-linenumber="123">
+
<code class="ruby"> fetch_custom_resource_mapping(item, 'DeletedAsset', DeletedAsset)</code>
</li>
<li class="never" data-hits="" data-linenumber="124">
@@ -11378,30 +11198,30 @@
<span class="hits">1</span>
<code class="ruby"> def fetch_custom_resource_mapping(item, type, default_class)</code>
</li>
- <li class="covered" data-hits="3156" data-linenumber="128">
- <span class="hits">3156</span>
+ <li class="covered" data-hits="1048" data-linenumber="128">
+ <span class="hits">1048</span>
<code class="ruby"> resources = resource_mapping[type]</code>
</li>
- <li class="covered" data-hits="3156" data-linenumber="129">
- <span class="hits">3156</span>
+ <li class="covered" data-hits="1048" data-linenumber="129">
+ <span class="hits">1048</span>
<code class="ruby"> return default_class if resources.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="130">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3156" data-linenumber="131">
- <span class="hits">3156</span>
+ <li class="covered" data-hits="1048" data-linenumber="131">
+ <span class="hits">1048</span>
<code class="ruby"> return resources if resources.is_a?(Class)</code>
</li>
<li class="missed" data-hits="0" data-linenumber="132">
@@ -11438,18 +11258,18 @@
<span class="hits">1</span>
<code class="ruby"> def fetch_array_class</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="138">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="138">
+ <span class="hits">56</span>
<code class="ruby"> return SyncPage if sync?</code>
</li>
- <li class="covered" data-hits="100" data-linenumber="139">
- <span class="hits">100</span>
+ <li class="covered" data-hits="56" data-linenumber="139">
+ <span class="hits">56</span>
<code class="ruby"> ::Contentful::Array</code>
</li>
<li class="never" data-hits="" data-linenumber="140">
@@ -11468,24 +11288,24 @@
<span class="hits">1</span>
<code class="ruby"> def localized?</code>
</li>
- <li class="covered" data-hits="3304" data-linenumber="143">
- <span class="hits">3304</span>
+ <li class="covered" data-hits="1073" data-linenumber="143">
+ <span class="hits">1073</span>
<code class="ruby"> return true if @localized</code>
</li>
- <li class="covered" data-hits="1968" data-linenumber="144">
- <span class="hits">1968</span>
+ <li class="covered" data-hits="979" data-linenumber="144">
+ <span class="hits">979</span>
<code class="ruby"> return true if array? && sync?</code>
</li>
- <li class="covered" data-hits="1700" data-linenumber="145">
- <span class="hits">1700</span>
+ <li class="covered" data-hits="979" data-linenumber="145">
+ <span class="hits">979</span>
<code class="ruby"> false</code>
</li>
<li class="never" data-hits="" data-linenumber="146">
@@ -11504,12 +11324,12 @@
<span class="hits">1</span>
<code class="ruby"> def array?</code>
</li>
- <li class="covered" data-hits="4979" data-linenumber="149">
- <span class="hits">4979</span>
+ <li class="covered" data-hits="2038" data-linenumber="149">
+ <span class="hits">2038</span>
<code class="ruby"> json.fetch('sys', {}).fetch('type', '') == 'Array'</code>
</li>
<li class="never" data-hits="" data-linenumber="150">
@@ -11528,12 +11348,12 @@
<span class="hits">1</span>
<code class="ruby"> def sync?</code>
</li>
- <li class="covered" data-hits="578" data-linenumber="153">
- <span class="hits">578</span>
+ <li class="covered" data-hits="124" data-linenumber="153">
+ <span class="hits">124</span>
<code class="ruby"> json.fetch('nextSyncUrl', nil) || json.fetch('nextPageUrl', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="154">
@@ -11558,12 +11378,12 @@
<span class="hits">1</span>
<code class="ruby"> def default_resource_mapping</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="158">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="158">
+ <span class="hits">1059</span>
<code class="ruby"> DEFAULT_RESOURCE_MAPPING.dup</code>
</li>
<li class="never" data-hits="" data-linenumber="159">
@@ -11588,12 +11408,12 @@
<span class="hits">1</span>
<code class="ruby"> def default_entry_mapping</code>
</li>
- <li class="covered" data-hits="3011" data-linenumber="163">
- <span class="hits">3011</span>
+ <li class="covered" data-hits="1059" data-linenumber="163">
+ <span class="hits">1059</span>
<code class="ruby"> DEFAULT_ENTRY_MAPPING.dup</code>
</li>
<li class="never" data-hits="" data-linenumber="164">
@@ -11691,36 +11511,36 @@
<span class="hits">1</span>
<code class="ruby"> def incoming_references(client = nil, query = {})</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="11">
- <span class="hits">3</span>
+ <li class="covered" data-hits="2" data-linenumber="11">
+ <span class="hits">2</span>
<code class="ruby"> return false unless client</code>
</li>
<li class="never" data-hits="" data-linenumber="12">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3" data-linenumber="13">
- <span class="hits">3</span>
+ <li class="covered" data-hits="2" data-linenumber="13">
+ <span class="hits">2</span>
<code class="ruby"> query = is_a?(Contentful::Entry) ? query.merge(links_to_entry: id) : query.merge(links_to_asset: id)</code>
</li>
<li class="never" data-hits="" data-linenumber="14">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="3" data-linenumber="15">
- <span class="hits">3</span>
+ <li class="covered" data-hits="2" data-linenumber="15">
+ <span class="hits">2</span>
<code class="ruby"> client.entries(query)</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -11747,15 +11567,15 @@
<div class="source_table" id="a54a8ab8e00230a5d92a5eb8a7e43f264a700db2">
<div class="header">
<h3>lib/contentful/response.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="red">80.0 %</span> covered</h4>
<div>
<b>55</b> relevant lines.
- <span class="green"><b>55</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>44</b> lines covered</span> and
+ <span class="red"><b>11</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -11914,91 +11734,91 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(raw, request = nil)</code>
</li>
- <li class="covered" data-hits="253" data-linenumber="27">
- <span class="hits">253</span>
+ <li class="covered" data-hits="58" data-linenumber="27">
+ <span class="hits">58</span>
<code class="ruby"> @raw = raw</code>
</li>
- <li class="covered" data-hits="253" data-linenumber="28">
- <span class="hits">253</span>
+ <li class="covered" data-hits="58" data-linenumber="28">
+ <span class="hits">58</span>
<code class="ruby"> @request = request</code>
</li>
- <li class="covered" data-hits="253" data-linenumber="29">
- <span class="hits">253</span>
+ <li class="covered" data-hits="58" data-linenumber="29">
+ <span class="hits">58</span>
<code class="ruby"> @status = :ok</code>
</li>
<li class="never" data-hits="" data-linenumber="30">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="253" data-linenumber="31">
- <span class="hits">253</span>
+ <li class="covered" data-hits="58" data-linenumber="31">
+ <span class="hits">58</span>
<code class="ruby"> if valid_http_response?</code>
</li>
- <li class="covered" data-hits="216" data-linenumber="32">
- <span class="hits">216</span>
+ <li class="covered" data-hits="57" data-linenumber="32">
+ <span class="hits">57</span>
<code class="ruby"> parse_json!</code>
</li>
- <li class="covered" data-hits="37" data-linenumber="33">
- <span class="hits">37</span>
+ <li class="covered" data-hits="1" data-linenumber="33">
+ <span class="hits">1</span>
<code class="ruby"> elsif no_content_response?</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"> @status = :no_content</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="35">
- <span class="hits">36</span>
+ <li class="covered" data-hits="1" data-linenumber="35">
+ <span class="hits">1</span>
<code class="ruby"> elsif invalid_response?</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="36">
- <span class="hits">18</span>
+ <li class="covered" data-hits="1" data-linenumber="36">
+ <span class="hits">1</span>
<code class="ruby"> parse_contentful_error</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="37">
- <span class="hits">18</span>
+ <li class="missed" data-hits="0" data-linenumber="37">
+
<code class="ruby"> elsif service_unavailable_response?</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="38">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="38">
+
<code class="ruby"> service_unavailable_error</code>
</li>
<li class="never" data-hits="" data-linenumber="39">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="15" data-linenumber="40">
- <span class="hits">15</span>
+ <li class="missed" data-hits="0" data-linenumber="40">
+
<code class="ruby"> parse_http_error</code>
</li>
<li class="never" data-hits="" data-linenumber="41">
@@ -12028,12 +11848,12 @@
<span class="hits">1</span>
<code class="ruby"> def load_json</code>
</li>
- <li class="covered" data-hits="299" data-linenumber="46">
- <span class="hits">299</span>
+ <li class="covered" data-hits="59" data-linenumber="46">
+ <span class="hits">59</span>
<code class="ruby"> MultiJson.load(unzip_response(raw))</code>
</li>
<li class="never" data-hits="" data-linenumber="47">
@@ -12064,12 +11884,12 @@
<span class="hits">1</span>
<code class="ruby"> def error_object?</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="52">
- <span class="hits">18</span>
+ <li class="covered" data-hits="1" data-linenumber="52">
+ <span class="hits">1</span>
<code class="ruby"> object['sys']['type'] == 'Error'</code>
</li>
<li class="never" data-hits="" data-linenumber="53">
@@ -12088,24 +11908,24 @@
<span class="hits">1</span>
<code class="ruby"> def parse_contentful_error</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="56">
- <span class="hits">18</span>
+ <li class="covered" data-hits="1" data-linenumber="56">
+ <span class="hits">1</span>
<code class="ruby"> @object = load_json</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="57">
- <span class="hits">18</span>
+ <li class="covered" data-hits="1" data-linenumber="57">
+ <span class="hits">1</span>
<code class="ruby"> @error_message = object['message'] if error_object?</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="58">
- <span class="hits">18</span>
+ <li class="covered" data-hits="1" data-linenumber="58">
+ <span class="hits">1</span>
<code class="ruby"> parse_http_error</code>
</li>
<li class="never" data-hits="" data-linenumber="59">
@@ -12124,12 +11944,12 @@
<span class="hits">1</span>
<code class="ruby"> def valid_http_response?</code>
</li>
- <li class="covered" data-hits="253" data-linenumber="62">
- <span class="hits">253</span>
+ <li class="covered" data-hits="58" data-linenumber="62">
+ <span class="hits">58</span>
<code class="ruby"> [200, 201].include?(raw.status)</code>
</li>
<li class="never" data-hits="" data-linenumber="63">
@@ -12148,13 +11968,13 @@
<span class="hits">1</span>
<code class="ruby"> def service_unavailable_response?</code>
</li>
- <li class="covered" data-hits="18" data-linenumber="66">
- <span class="hits">18</span>
+ <li class="missed" data-hits="0" data-linenumber="66">
+
<code class="ruby"> @raw.status == 503</code>
</li>
<li class="never" data-hits="" data-linenumber="67">
@@ -12172,25 +11992,25 @@
<span class="hits">1</span>
<code class="ruby"> def service_unavailable_error</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="70">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="70">
+
<code class="ruby"> @status = :error</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="71">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="71">
+
<code class="ruby"> @error_message = '503 - Service Unavailable'</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="72">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="72">
+
<code class="ruby"> @object = Error[@raw.status].new(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="73">
@@ -12208,18 +12028,18 @@
<span class="hits">1</span>
<code class="ruby"> def parse_http_error</code>
</li>
- <li class="covered" data-hits="33" data-linenumber="76">
- <span class="hits">33</span>
+ <li class="covered" data-hits="1" data-linenumber="76">
+ <span class="hits">1</span>
<code class="ruby"> @status = :error</code>
</li>
- <li class="covered" data-hits="33" data-linenumber="77">
- <span class="hits">33</span>
+ <li class="covered" data-hits="1" data-linenumber="77">
+ <span class="hits">1</span>
<code class="ruby"> @object = Error[raw.status].new(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="78">
@@ -12238,12 +12058,12 @@
<span class="hits">1</span>
<code class="ruby"> def invalid_response?</code>
</li>
- <li class="covered" data-hits="36" data-linenumber="81">
- <span class="hits">36</span>
+ <li class="covered" data-hits="1" data-linenumber="81">
+ <span class="hits">1</span>
<code class="ruby"> [400, 404].include?(raw.status)</code>
</li>
<li class="never" data-hits="" data-linenumber="82">
@@ -12262,12 +12082,12 @@
<span class="hits">1</span>
<code class="ruby"> def no_content_response?</code>
</li>
- <li class="covered" data-hits="37" data-linenumber="85">
- <span class="hits">37</span>
+ <li class="covered" data-hits="1" data-linenumber="85">
+ <span class="hits">1</span>
<code class="ruby"> raw.to_s == '' && raw.status == 204</code>
</li>
<li class="never" data-hits="" data-linenumber="86">
@@ -12286,37 +12106,37 @@
<span class="hits">1</span>
<code class="ruby"> def parse_json!</code>
</li>
- <li class="covered" data-hits="216" data-linenumber="89">
- <span class="hits">216</span>
+ <li class="covered" data-hits="57" data-linenumber="89">
+ <span class="hits">57</span>
<code class="ruby"> @object = load_json</code>
</li>
<li class="never" data-hits="" data-linenumber="90">
<code class="ruby"> rescue MultiJson::LoadError => error</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="91">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="91">
+
<code class="ruby"> @error_message = error.message</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="92">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="92">
+
<code class="ruby"> @status = :error</code>
</li>
- <li class="covered" data-hits="3" data-linenumber="93">
- <span class="hits">3</span>
+ <li class="missed" data-hits="0" data-linenumber="93">
+
<code class="ruby"> UnparsableJson.new(self)</code>
</li>
<li class="never" data-hits="" data-linenumber="94">
@@ -12334,48 +12154,48 @@
<span class="hits">1</span>
<code class="ruby"> def unzip_response(response)</code>
</li>
- <li class="covered" data-hits="299" data-linenumber="97">
- <span class="hits">299</span>
+ <li class="covered" data-hits="59" data-linenumber="97">
+ <span class="hits">59</span>
<code class="ruby"> parsed_response = response.to_s</code>
</li>
- <li class="covered" data-hits="299" data-linenumber="98">
- <span class="hits">299</span>
+ <li class="covered" data-hits="59" data-linenumber="98">
+ <span class="hits">59</span>
<code class="ruby"> if response.headers['Content-Encoding'].eql?('gzip')</code>
</li>
- <li class="covered" data-hits="71" data-linenumber="99">
- <span class="hits">71</span>
+ <li class="covered" data-hits="48" data-linenumber="99">
+ <span class="hits">48</span>
<code class="ruby"> sio = StringIO.new(parsed_response)</code>
</li>
- <li class="covered" data-hits="71" data-linenumber="100">
- <span class="hits">71</span>
+ <li class="covered" data-hits="48" data-linenumber="100">
+ <span class="hits">48</span>
<code class="ruby"> gz = Zlib::GzipReader.new(sio)</code>
</li>
- <li class="covered" data-hits="71" data-linenumber="101">
- <span class="hits">71</span>
+ <li class="covered" data-hits="48" data-linenumber="101">
+ <span class="hits">48</span>
<code class="ruby"> gz.read</code>
</li>
<li class="never" data-hits="" data-linenumber="102">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="228" data-linenumber="103">
- <span class="hits">228</span>
+ <li class="covered" data-hits="11" data-linenumber="103">
+ <span class="hits">11</span>
<code class="ruby"> parsed_response</code>
</li>
<li class="never" data-hits="" data-linenumber="104">
@@ -12408,15 +12228,15 @@
<div class="source_table" id="42827798fb56cb87d145e81d9ae46dfe97e9818b">
<div class="header">
<h3>lib/contentful/space.rb</h3>
- <h4><span class="yellow">83.33 %</span> covered</h4>
+ <h4><span class="red">58.33 %</span> covered</h4>
<div>
<b>12</b> relevant lines.
- <span class="green"><b>10</b> lines covered</span> and
- <span class="red"><b>2</b> lines missed.</span>
+ <span class="green"><b>7</b> lines covered</span> and
+ <span class="red"><b>5</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -12479,31 +12299,31 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(item, *)</code>
</li>
- <li class="covered" data-hits="9" data-linenumber="11">
- <span class="hits">9</span>
+ <li class="missed" data-hits="0" data-linenumber="11">
+
<code class="ruby"> super</code>
</li>
<li class="never" data-hits="" data-linenumber="12">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="9" data-linenumber="13">
- <span class="hits">9</span>
+ <li class="missed" data-hits="0" data-linenumber="13">
+
<code class="ruby"> @name = item.fetch('name', nil)</code>
</li>
- <li class="covered" data-hits="27" data-linenumber="14">
- <span class="hits">27</span>
+ <li class="missed" data-hits="0" data-linenumber="14">
+
<code class="ruby"> @locales = item.fetch('locales', []).map { |locale| Locale.new(locale) }</code>
</li>
<li class="never" data-hits="" data-linenumber="15">
@@ -12571,15 +12391,15 @@
<div class="source_table" id="a300a2b740de48d4aa41783c879260ce3e4785ba">
<div class="header">
<h3>lib/contentful/support.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="green">96.0 %</span> covered</h4>
<div>
<b>25</b> relevant lines.
- <span class="green"><b>25</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>24</b> lines covered</span> and
+ <span class="red"><b>1</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -12648,12 +12468,12 @@
<span class="hits">1</span>
<code class="ruby"> def snakify(object, skip = false)</code>
</li>
- <li class="covered" data-hits="105145" data-linenumber="12">
- <span class="hits">105145</span>
+ <li class="covered" data-hits="23296" data-linenumber="12">
+ <span class="hits">23296</span>
<code class="ruby"> return object if skip</code>
</li>
<li class="never" data-hits="" data-linenumber="13">
@@ -12690,12 +12510,12 @@
<code class="ruby"> .tr('-', '_')</code>
</li>
- <li class="covered" data-hits="103286" data-linenumber="19">
- <span class="hits">103286</span>
+ <li class="covered" data-hits="22423" data-linenumber="19">
+ <span class="hits">22423</span>
<code class="ruby"> .downcase</code>
</li>
<li class="never" data-hits="" data-linenumber="20">
@@ -12714,24 +12534,24 @@
<span class="hits">1</span>
<code class="ruby"> def unresolvable?(value, errors)</code>
</li>
- <li class="covered" data-hits="6265" data-linenumber="23">
- <span class="hits">6265</span>
+ <li class="covered" data-hits="2146" data-linenumber="23">
+ <span class="hits">2146</span>
<code class="ruby"> return true if value.nil?</code>
</li>
<li class="never" data-hits="" data-linenumber="24">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="6281" data-linenumber="25">
- <span class="hits">6281</span>
+ <li class="covered" data-hits="2162" data-linenumber="25">
+ <span class="hits">2162</span>
<code class="ruby"> errors.any? { |i| i.fetch('details', {}).fetch('id', nil) == value['sys']['id'] }</code>
</li>
<li class="never" data-hits="" data-linenumber="26">
@@ -12780,12 +12600,12 @@
<span class="hits">1</span>
<code class="ruby"> def link?(value)</code>
</li>
- <li class="covered" data-hits="12685" data-linenumber="34">
- <span class="hits">12685</span>
+ <li class="covered" data-hits="4275" data-linenumber="34">
+ <span class="hits">4275</span>
<code class="ruby"> value.is_a?(::Hash) &&</code>
</li>
<li class="never" data-hits="" data-linenumber="35">
@@ -12840,24 +12660,24 @@
<span class="hits">1</span>
<code class="ruby"> def link_array?(value)</code>
</li>
- <li class="covered" data-hits="8289" data-linenumber="44">
- <span class="hits">8289</span>
+ <li class="covered" data-hits="2705" data-linenumber="44">
+ <span class="hits">2705</span>
<code class="ruby"> return link?(value[0]) if value.is_a?(::Array) && !value.empty?</code>
</li>
<li class="never" data-hits="" data-linenumber="45">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="6807" data-linenumber="46">
- <span class="hits">6807</span>
+ <li class="covered" data-hits="2173" data-linenumber="46">
+ <span class="hits">2173</span>
<code class="ruby"> false</code>
</li>
<li class="never" data-hits="" data-linenumber="47">
@@ -12912,18 +12732,18 @@
<span class="hits">1</span>
<code class="ruby"> def resource_for_link(link, includes)</code>
</li>
- <li class="covered" data-hits="2804" data-linenumber="56">
- <span class="hits">2804</span>
+ <li class="covered" data-hits="1003" data-linenumber="56">
+ <span class="hits">1003</span>
<code class="ruby"> includes.detect do |i|</code>
</li>
- <li class="covered" data-hits="17398" data-linenumber="57">
- <span class="hits">17398</span>
+ <li class="covered" data-hits="2638" data-linenumber="57">
+ <span class="hits">2638</span>
<code class="ruby"> i['sys']['id'] == link['sys']['id'] &&</code>
</li>
<li class="never" data-hits="" data-linenumber="58">
@@ -12990,31 +12810,31 @@
<span class="hits">1</span>
<code class="ruby"> def includes_from_response(json, raw = true)</code>
</li>
- <li class="covered" data-hits="151" data-linenumber="69">
- <span class="hits">151</span>
+ <li class="covered" data-hits="56" data-linenumber="69">
+ <span class="hits">56</span>
<code class="ruby"> includes = if raw</code>
</li>
- <li class="covered" data-hits="144" data-linenumber="70">
- <span class="hits">144</span>
+ <li class="covered" data-hits="56" data-linenumber="70">
+ <span class="hits">56</span>
<code class="ruby"> json['items'].dup</code>
</li>
<li class="never" data-hits="" data-linenumber="71">
<code class="ruby"> else</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="72">
- <span class="hits">7</span>
+ <li class="missed" data-hits="0" data-linenumber="72">
+
<code class="ruby"> json['items'].map(&:raw)</code>
</li>
<li class="never" data-hits="" data-linenumber="73">
@@ -13026,24 +12846,24 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="151" data-linenumber="75">
- <span class="hits">151</span>
+ <li class="covered" data-hits="56" data-linenumber="75">
+ <span class="hits">56</span>
<code class="ruby"> %w[Entry Asset].each do |type|</code>
</li>
- <li class="covered" data-hits="302" data-linenumber="76">
- <span class="hits">302</span>
+ <li class="covered" data-hits="112" data-linenumber="76">
+ <span class="hits">112</span>
<code class="ruby"> if json.fetch('includes', {}).key?(type)</code>
</li>
- <li class="covered" data-hits="98" data-linenumber="77">
- <span class="hits">98</span>
+ <li class="covered" data-hits="66" data-linenumber="77">
+ <span class="hits">66</span>
<code class="ruby"> includes.concat(json['includes'].fetch(type, []))</code>
</li>
<li class="never" data-hits="" data-linenumber="78">
@@ -13062,12 +12882,12 @@
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="151" data-linenumber="81">
- <span class="hits">151</span>
+ <li class="covered" data-hits="56" data-linenumber="81">
+ <span class="hits">56</span>
<code class="ruby"> includes</code>
</li>
<li class="never" data-hits="" data-linenumber="82">
@@ -13100,15 +12920,15 @@
<div class="source_table" id="84dd5a82215a9c45df06f943a5b88003a007c2e3">
<div class="header">
<h3>lib/contentful/sync.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="red">44.74 %</span> covered</h4>
<div>
<b>38</b> relevant lines.
- <span class="green"><b>38</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>17</b> lines covered</span> and
+ <span class="red"><b>21</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -13183,25 +13003,25 @@
<span class="hits">1</span>
<code class="ruby"> def initialize(client, options_or_url)</code>
</li>
- <li class="covered" data-hits="43" data-linenumber="13">
- <span class="hits">43</span>
+ <li class="missed" data-hits="0" data-linenumber="13">
+
<code class="ruby"> @client = client</code>
</li>
- <li class="covered" data-hits="43" data-linenumber="14">
- <span class="hits">43</span>
+ <li class="missed" data-hits="0" data-linenumber="14">
+
<code class="ruby"> @next_sync_url = nil</code>
</li>
- <li class="covered" data-hits="43" data-linenumber="15">
- <span class="hits">43</span>
+ <li class="missed" data-hits="0" data-linenumber="15">
+
<code class="ruby"> @first_page_options_or_url = options_or_url</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -13249,43 +13069,43 @@
<span class="hits">1</span>
<code class="ruby"> def each_page</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="24">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="24">
+
<code class="ruby"> page = first_page</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="25">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="25">
+
<code class="ruby"> yield page if block_given?</code>
</li>
<li class="never" data-hits="" data-linenumber="26">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="2" data-linenumber="27">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="27">
+
<code class="ruby"> until completed?</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="28">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="28">
+
<code class="ruby"> page = page.next_page</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="29">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="29">
+
<code class="ruby"> yield page if block_given?</code>
</li>
<li class="never" data-hits="" data-linenumber="30">
@@ -13327,13 +13147,13 @@
<span class="hits">1</span>
<code class="ruby"> def first_page</code>
</li>
- <li class="covered" data-hits="31" data-linenumber="37">
- <span class="hits">31</span>
+ <li class="missed" data-hits="0" data-linenumber="37">
+
<code class="ruby"> get(@first_page_options_or_url)</code>
</li>
<li class="never" data-hits="" data-linenumber="38">
@@ -13375,13 +13195,13 @@
<code class="ruby"> # rubocop:disable Style/DoubleNegation</code>
</li>
- <li class="covered" data-hits="4" data-linenumber="45">
- <span class="hits">4</span>
+ <li class="missed" data-hits="0" data-linenumber="45">
+
<code class="ruby"> !!next_sync_url</code>
</li>
<li class="never" data-hits="" data-linenumber="46">
@@ -13423,19 +13243,19 @@
<span class="hits">1</span>
<code class="ruby"> def each_item(&block)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="53">
+
<code class="ruby"> each_page do |page|</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="54">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="54">
+
<code class="ruby"> page.each_item(&block)</code>
</li>
<li class="never" data-hits="" data-linenumber="55">
@@ -13465,55 +13285,55 @@
<span class="hits">1</span>
<code class="ruby"> def get(options_or_url)</code>
</li>
- <li class="covered" data-hits="47" data-linenumber="60">
- <span class="hits">47</span>
+ <li class="missed" data-hits="0" data-linenumber="60">
+
<code class="ruby"> page = fetch_page(options_or_url)</code>
</li>
<li class="never" data-hits="" data-linenumber="61">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="47" data-linenumber="62">
- <span class="hits">47</span>
+ <li class="missed" data-hits="0" data-linenumber="62">
+
<code class="ruby"> return page if @client.configuration[:raw_mode]</code>
</li>
<li class="never" data-hits="" data-linenumber="63">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="44" data-linenumber="64">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="64">
+
<code class="ruby"> link_page_to_sync! page</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="65">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="65">
+
<code class="ruby"> update_sync_state_from! page</code>
</li>
<li class="never" data-hits="" data-linenumber="66">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="44" data-linenumber="67">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="67">
+
<code class="ruby"> page</code>
</li>
<li class="never" data-hits="" data-linenumber="68">
@@ -13543,19 +13363,19 @@
<span class="hits">1</span>
<code class="ruby"> def fetch_page(options_or_url)</code>
</li>
- <li class="covered" data-hits="47" data-linenumber="73">
- <span class="hits">47</span>
+ <li class="missed" data-hits="0" data-linenumber="73">
+
<code class="ruby"> return Request.new(@client, options_or_url).get if options_or_url.is_a? String</code>
</li>
- <li class="covered" data-hits="30" data-linenumber="74">
- <span class="hits">30</span>
+ <li class="missed" data-hits="0" data-linenumber="74">
+
<code class="ruby"> Request.new(@client, @client.environment_url('/sync'), options_or_url).get</code>
</li>
<li class="never" data-hits="" data-linenumber="75">
@@ -13573,13 +13393,13 @@
<span class="hits">1</span>
<code class="ruby"> def link_page_to_sync!(page)</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="78">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="78">
+
<code class="ruby"> page.instance_variable_set :@sync, self</code>
</li>
<li class="never" data-hits="" data-linenumber="79">
@@ -13597,13 +13417,13 @@
<span class="hits">1</span>
<code class="ruby"> def update_sync_state_from!(page)</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="82">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="82">
+
<code class="ruby"> @next_sync_url = page.next_sync_url</code>
</li>
<li class="never" data-hits="" data-linenumber="83">
@@ -13629,15 +13449,15 @@
<div class="source_table" id="99e7ff3ec5cef4c1f8a70725a19da05567b157fd">
<div class="header">
<h3>lib/contentful/sync_page.rb</h3>
- <h4><span class="green">94.74 %</span> covered</h4>
+ <h4><span class="red">57.89 %</span> covered</h4>
<div>
<b>19</b> relevant lines.
- <span class="green"><b>18</b> lines covered</span> and
- <span class="red"><b>1</b> lines missed.</span>
+ <span class="green"><b>11</b> lines covered</span> and
+ <span class="red"><b>8</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -13724,37 +13544,37 @@
<code class="ruby"> }, *)</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="15">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="15">
+
<code class="ruby"> super(item, configuration, true)</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="44" data-linenumber="17">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="17">
+
<code class="ruby"> @items = item.fetch('items', [])</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="18">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="18">
+
<code class="ruby"> @next_sync_url = item.fetch('nextSyncUrl', nil)</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="19">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="19">
+
<code class="ruby"> @next_page_url = item.fetch('nextPageUrl', nil)</code>
</li>
<li class="never" data-hits="" data-linenumber="20">
@@ -13820,13 +13640,13 @@
<span class="hits">1</span>
<code class="ruby"> def next_page</code>
</li>
- <li class="covered" data-hits="5" data-linenumber="31">
- <span class="hits">5</span>
+ <li class="missed" data-hits="0" data-linenumber="31">
+
<code class="ruby"> sync.get(next_page_url) if next_page?</code>
</li>
<li class="never" data-hits="" data-linenumber="32">
@@ -13868,13 +13688,13 @@
<code class="ruby"> # rubocop:disable Style/DoubleNegation</code>
</li>
- <li class="covered" data-hits="7" data-linenumber="39">
- <span class="hits">7</span>
+ <li class="missed" data-hits="0" data-linenumber="39">
+
<code class="ruby"> !!next_page_url</code>
</li>
<li class="never" data-hits="" data-linenumber="40">
@@ -13916,13 +13736,13 @@
<span class="hits">1</span>
<code class="ruby"> def last_page?</code>
</li>
- <li class="covered" data-hits="2" data-linenumber="47">
- <span class="hits">2</span>
+ <li class="missed" data-hits="0" data-linenumber="47">
+
<code class="ruby"> !next_page_url</code>
</li>
<li class="never" data-hits="" data-linenumber="48">
@@ -13945,13097 +13765,10 @@
</ol>
</pre>
</div>
- <div class="source_table" id="26151d16243d86e4a0f5aa143518973c5fc190f5">
- <div class="header">
- <h3>spec/asset_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>104</b> relevant lines.
- <span class="green"><b>104</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 'spec_helper'</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 Contentful::Asset do</code>
- </li>
-
- <li class="covered" data-hits="33" data-linenumber="4">
- <span class="hits">33</span>
-
- <code class="ruby"> let(:asset) { vcr('asset') { create_client.asset('nyancat') } }</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"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.sys.keys.sample).to be_a Symbol</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="10">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="11">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.id).to eq 'nyancat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.type).to eq 'Asset'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #space' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.space).to be_a Contentful::Link</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #created_at' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.created_at).to be_a DateTime</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #updated_at' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.updated_at).to be_a DateTime</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"> it 'has #revision' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.revision).to eq 1</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="36">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Fields' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="38">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #title' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="39">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.title).to eq 'Nyan Cat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="41">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'could have #description' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset).to respond_to :description</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="45">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #file' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file).to be_a Contentful::File</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="51">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#image_url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns #url of #file without parameter' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.image_url).to eq asset.file.url</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="54">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="55">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'adds image options if given' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> url = asset.image_url(width: 100, format: 'jpg', quality: 50, focus: 'top_right', fit: 'thumb', fl: 'progressive', background: 'rgb:ff0000')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="58">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(url).to include asset.file.url</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="59">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(url).to include '?w=100&fm=jpg&q=50&f=top_right&bg=rgb%3Aff0000&fit=thumb&fl=progressive'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="61">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="62">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="63">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="64">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns #url of #file without parameter' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="65">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.url).to eq asset.file.url</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="66">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="67">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="68">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'adds image options if given' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="69">
- <span class="hits">1</span>
-
- <code class="ruby"> url = asset.url(width: 100, format: 'jpg', quality: 50, focus: 'top_right', fit: 'thumb', fl: 'progressive', background: 'rgb:ff0000')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="70">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(url).to include asset.file.url</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="71">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(url).to include '?w=100&fm=jpg&q=50&f=top_right&bg=rgb%3Aff0000&fit=thumb&fl=progressive'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="72">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="73">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="74">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="75">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can be marshalled' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="76">
- <span class="hits">1</span>
-
- <code class="ruby"> marshalled = Marshal.dump(asset)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="77">
- <span class="hits">1</span>
-
- <code class="ruby"> unmarshalled = Marshal.load(marshalled)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="78">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="79">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(unmarshalled.title).to eq 'Nyan Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="80">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(unmarshalled.file).to be_a Contentful::File</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="81">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="82">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="83">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="84">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'incoming links' do</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="85">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:client) { create_client }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="86">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="87">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will fetch entries referencing the asset using a query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="88">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/search_link_to_asset') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="89">
- <span class="hits">1</span>
-
- <code class="ruby"> entries = client.entries(links_to_asset: 'nyancat')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="90">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries).not_to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="91">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.count).to eq 1</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="92">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.first.id).to eq 'nyancat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="93">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="94">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="95">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="96">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will fetch entries referencing the entry using instance method' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="97">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/search_link_to_asset') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="98">
- <span class="hits">1</span>
-
- <code class="ruby"> entries = asset.incoming_references client</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="99">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries).not_to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="100">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.count).to eq 1</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="101">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.first.id).to eq 'nyancat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="102">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="103">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="104">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="105">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="106">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="107">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'select operator' do</code>
- </li>
-
- <li class="covered" data-hits="5" data-linenumber="108">
- <span class="hits">5</span>
-
- <code class="ruby"> let(:client) { create_client }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="109">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="110">
- <span class="hits">1</span>
-
- <code class="ruby"> context 'with sys sent' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="111">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'properly creates an entry' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="112">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('asset/select_only_sys') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="113">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = client.assets(select: ['sys']).first</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="114">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.fields).to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="115">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.sys).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="116">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="117">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="118">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="119">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can contain only one field' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="120">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('asset/select_one_field') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="121">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = client.assets(select: ['sys', 'fields.file']).first</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="122">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.fields.keys).to eq([:file])</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="123">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="124">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="125">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="126">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="127">
- <span class="hits">1</span>
-
- <code class="ruby"> context 'without sys sent' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="128">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will enforce sys anyway' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="129">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('asset/select_no_sys') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="130">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = client.assets(select: ['fields'], 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="131">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="132">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.id).to eq 'nyancat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="133">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.sys).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="134">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="135">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="136">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="137">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'works with empty array as well, as sys is enforced' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="138">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('asset/select_empty_array') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="139">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = client.assets(select: [], 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="140">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="141">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.id).to eq 'nyancat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="142">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.sys).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="143">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="144">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="145">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="146">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="147">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="148">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'issues' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="149">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'serializes files correctly for every locale - #129' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="150">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('assets/issues_129') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="151">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="152">
-
-
- <code class="ruby"> space: 'bht13amj0fva',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="153">
-
-
- <code class="ruby"> access_token: 'bb703a05e107148bed6ee246a9f6b3678c63fed7335632eb68fe1b689c801534'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="154">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="155">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="156">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = client.assets('sys.id' => '14bZJKTr6AoaGyeg4kYiWq', locale: '*').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="157">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="158">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file).to be_a ::Contentful::File</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="159">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.file_name).to eq 'Flag_of_the_United_States.svg'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="160">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="161">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.fields[:file]).to be_a ::Contentful::File</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="162">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.fields[:file].file_name).to eq 'Flag_of_the_United_States.svg'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="163">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="164">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.fields('es')[:file]).to be_a ::Contentful::File</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="165">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.fields('es')[:file].file_name).to eq 'Flag_of_Spain.svg'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="166">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="167">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="168">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="169">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'properly serializes files for non-default locales on localized requests - jekyll-contentful-data-import #46' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="170">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('assets/issues_jekyll_46') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="171">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="172">
-
-
- <code class="ruby"> space: 'bht13amj0fva',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="173">
-
-
- <code class="ruby"> access_token: 'bb703a05e107148bed6ee246a9f6b3678c63fed7335632eb68fe1b689c801534',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="174">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="175">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="176">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = client.assets('sys.id' => '14bZJKTr6AoaGyeg4kYiWq', locale: 'es').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="177">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="178">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file).to be_a ::Contentful::File</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="179">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.file_name).to eq 'Flag_of_Spain.svg'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="180">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="181">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="182">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="183">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="184">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'camelCase' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="185">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'properties now are accessed with camelcase' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="186">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('asset') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="187">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = create_client(use_camel_case: true).asset('nyancat')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="188">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.fileName).to eq 'Nyan_cat_250px_frame.png'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="189">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="190">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="191">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="192">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="f95dca85be477fbdc528fdb56a7e036b592793bf">
- <div class="header">
- <h3>spec/auto_includes_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>7</b> relevant lines.
- <span class="green"><b>7</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 'spec_helper'</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 'Auto-include resources' do</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="4">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:entries) { vcr('entries') { create_client.entries } } # entries come with asset includes</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"> it 'replaces Contentful::Links which are actually included with the resource' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> asset = entries.items[1].fields[:image]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="8">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset).not_to be_a Contentful::Link</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="10">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset).to be_a Contentful::Asset</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>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="a5b449a98635efa082944faacae851b1dab9ab8c">
- <div class="header">
- <h3>spec/client_class_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>37</b> relevant lines.
- <span class="green"><b>37</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 'spec_helper'</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 Contentful::Client do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#get' do</code>
- </li>
-
- <li class="covered" data-hits="9" data-linenumber="5">
- <span class="hits">9</span>
-
- <code class="ruby"> let(:client) { create_client }</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="6">
- <span class="hits">2</span>
-
- <code class="ruby"> let(:proxy_client) { create_client(proxy_host: '183.207.232.194',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="7">
-
-
- <code class="ruby"> proxy_port: 8080,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="8">
-
-
- <code class="ruby"> secure: false) }</code>
- </li>
-
- <li class="covered" data-hits="9" data-linenumber="9">
- <span class="hits">9</span>
-
- <code class="ruby"> let(:request) { Contentful::Request.new(nil, client.environment_url('/content_types'), nil, 'cat') }</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 'uses #base_url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client).to receive(:base_url).and_call_original</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"> vcr('content_type') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> client.get(request)</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'uses #request_headers' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client).to receive(:request_headers).and_call_original</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="21">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('content_type') { client.get(request) }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'uses Request#url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request).to receive(:url).and_call_original</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="26">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('content_type') { client.get(request) }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="28">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'uses Request#query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="30">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request).to receive(:query).twice.and_call_original</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="31">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('content_type') { client.get(request) }</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="34">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'calls #get_http' do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="35">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(client.class).to receive(:get_http).with(client.base_url + request.url, request.query, client.request_headers, client.proxy_params) { raw_fixture('content_type') }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> client.get(request)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="37">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="39">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'calls #get_http via proxy' do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="40">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(proxy_client.class).to receive(:get_http).with(proxy_client.base_url + request.url, request.query, proxy_client.request_headers, proxy_client.proxy_params) { raw_fixture('content_type') }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> proxy_client.get(request)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(proxy_client.proxy_params[:host]).to eq '183.207.232.194'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(proxy_client.proxy_params[:port]).to eq 8080</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="45">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'build_resources parameter' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns Contentful::Resource object if second parameter is true [default]' do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="48">
- <span class="hits">2</span>
-
- <code class="ruby"> res = vcr('content_type') { client.get(request) }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="49">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(res).to be_a Contentful::BaseResource</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="51">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns a Contentful::Response object if second parameter is not true' do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="53">
- <span class="hits">2</span>
-
- <code class="ruby"> res = vcr('content_type') { client.get(request, false) }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="54">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(res).to be_a Contentful::Response</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="55">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="56">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="57">
-
-
- <code class="ruby"></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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="60">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#sync' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'creates a new Sync object' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="62">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(create_client.sync).to be_a Contentful::Sync</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="63">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="64">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="65">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="d051f37597cb573fb8f2516b5cdf4009ca5c4e80">
- <div class="header">
- <h3>spec/client_configuration_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>152</b> relevant lines.
- <span class="green"><b>152</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 'spec_helper'</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 'Client Configuration Options' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':space' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="5">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'is required' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="6">
- <span class="hits">1</span>
-
- <code class="ruby"> expect do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> Contentful::Client.new(access_token: 'b4c0n73n7fu1')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="8">
-
-
- <code class="ruby"> end.to raise_error(ArgumentError)</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="11">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':access_token' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'is required' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="14">
- <span class="hits">1</span>
-
- <code class="ruby"> expect do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> Contentful::Client.new(space: 'cfexampleapi')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="16">
-
-
- <code class="ruby"> end.to raise_error(ArgumentError)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':secure' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will use https [default]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"> create_client.base_url</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"> ).to start_with 'https://'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="25">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will use http when secure set to false' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="29">
-
-
- <code class="ruby"> create_client(secure: false).base_url</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="30">
-
-
- <code class="ruby"> ).to start_with 'http://'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="31">
-
-
- <code class="ruby"> end</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="34">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':raise_errors' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="35">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will raise response errors if set to true [default]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> expect_vcr('not found')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
-
- <code class="ruby"> create_client.content_type 'not found'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"> end.to raise_error Contentful::NotFound</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will not raise response errors if set to false' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> res = nil</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="43">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="44">
- <span class="hits">1</span>
-
- <code class="ruby"> expect_vcr('not found')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="45">
- <span class="hits">1</span>
-
- <code class="ruby"> res = create_client(raise_errors: false).content_type 'not found'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="46">
-
-
- <code class="ruby"> end.not_to raise_error</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(res).to be_instance_of Contentful::NotFound</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="51">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':dynamic_entries' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
-
- <code class="ruby"> before :each do</code>
- </li>
-
- <li class="covered" data-hits="6" data-linenumber="53">
- <span class="hits">6</span>
-
- <code class="ruby"> Contentful::ContentTypeCache.clear!</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="54">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="55">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will create dynamic entries if dynamic_entry_cache is not empty' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(dynamic_entries: :manual)</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="58">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('entry_cache') { client.update_dynamic_entry_cache! }</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="59">
- <span class="hits">2</span>
-
- <code class="ruby"> entry = vcr('nyancat') { client.entry('nyancat') }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry).to be_a Contentful::Entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="62">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="63">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="64">
- <span class="hits">1</span>
-
- <code class="ruby"> context ':auto' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="65">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will call update dynamic_entry_cache on start-up' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="66">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry_cache') do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="67">
- <span class="hits">1</span>
-
- <code class="ruby"> create_client(dynamic_entries: :auto)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="68">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="69">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::ContentTypeCache.cache).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="70">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="71">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="72">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="73">
- <span class="hits">1</span>
-
- <code class="ruby"> context ':manual' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="74">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will not call #update_dynamic_entry_cache! on start-up' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="75">
- <span class="hits">1</span>
-
- <code class="ruby"> create_client(dynamic_entries: :manual)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="76">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::ContentTypeCache.cache).to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="77">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="78">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="79">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="80">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#update_dynamic_entry_cache!' do</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="81">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:client) { create_client(dynamic_entries: :manual) }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="82">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="83">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will fetch all content_types' do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="84">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(client).to receive(:content_types).with(limit: 1000) { {} }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="85">
- <span class="hits">1</span>
-
- <code class="ruby"> client.update_dynamic_entry_cache!</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="86">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="87">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="88">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will save dynamic entries in @dynamic_entry_cache' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="89">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry_cache')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="90">
- <span class="hits">1</span>
-
- <code class="ruby"> client.update_dynamic_entry_cache!</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="91">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="92">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::ContentTypeCache.cache).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="93">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="94">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="95">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="96">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#register_dynamic_entry' do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="97">
- <span class="hits">2</span>
-
- <code class="ruby"> let(:client) { create_client(dynamic_entries: :manual) }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="98">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="99">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can be used to register a dynamic entry manually' do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="100">
- <span class="hits">2</span>
-
- <code class="ruby"> cat = vcr('content_type') { client.content_type 'cat' }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="101">
- <span class="hits">1</span>
-
- <code class="ruby"> client.register_dynamic_entry 'cat', cat</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="102">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="103">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::ContentTypeCache.cache).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="104">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="105">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="106">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="107">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="108">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':api_url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="109">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'is "cdn.contentful.com" [default]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="110">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="111">
-
-
- <code class="ruby"> create_client.configuration[:api_url]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="112">
-
-
- <code class="ruby"> ).to eq 'cdn.contentful.com'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="113">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="114">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="115">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will be used as base url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="116">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="117">
-
-
- <code class="ruby"> create_client(api_url: 'cdn2.contentful.com').base_url</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="118">
-
-
- <code class="ruby"> ).to start_with 'https://cdn2.contentful.com'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="119">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="120">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="121">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="122">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':api_version' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="123">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'is 1 [default]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="124">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="125">
-
-
- <code class="ruby"> create_client.configuration[:api_version]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="126">
-
-
- <code class="ruby"> ).to eq 1</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="127">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="128">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="129">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will used for the http content type request header' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="130">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="131">
-
-
- <code class="ruby"> create_client(api_version: 2).request_headers['Content-Type']</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="132">
-
-
- <code class="ruby"> ).to eq 'application/vnd.contentful.delivery.v2+json'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="133">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="134">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="135">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="136">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':authentication_mechanism' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="137">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':header [default]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="138">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will add the :access_token as authorization bearer token request header' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="139">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="140">
-
-
- <code class="ruby"> create_client.request_headers['Authorization']</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="141">
-
-
- <code class="ruby"> ).to eq 'Bearer b4c0n73n7fu1'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="142">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="143">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="144">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will not add :access_token to query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="145">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="146">
-
-
- <code class="ruby"> create_client.request_query({})['access_token']</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="147">
-
-
- <code class="ruby"> ).to be_nil</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="148">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="149">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="150">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="151">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':query_string' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="152">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will add the :access_token to query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="153">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="154">
-
-
- <code class="ruby"> create_client(authentication_mechanism: :query_string).</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="155">
-
-
- <code class="ruby"> request_query({})['access_token']</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="156">
-
-
- <code class="ruby"> ).to eq 'b4c0n73n7fu1'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="157">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="158">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="159">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will not add the :access_token as authorization bearer token request header' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="160">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="161">
-
-
- <code class="ruby"> create_client(authentication_mechanism: :query_string).</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="162">
-
-
- <code class="ruby"> request_headers['Authorization']</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="163">
-
-
- <code class="ruby"> ).to be_nil</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="164">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="165">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="166">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="167">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="168">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':resource_mapping' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="169">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'lets you register your own resource classes for certain response types' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="170">
- <span class="hits">1</span>
-
- <code class="ruby"> class MyBetterAsset < Contentful::Asset</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="171">
- <span class="hits">1</span>
-
- <code class="ruby"> def https_image_url</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="172">
- <span class="hits">1</span>
-
- <code class="ruby"> image_url.sub %r{\A//}, 'https://'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="173">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="174">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="175">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="176">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="177">
-
-
- <code class="ruby"> resource_mapping: {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="178">
-
-
- <code class="ruby"> 'Asset' => MyBetterAsset,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="179">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="180">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="181">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="182">
- <span class="hits">2</span>
-
- <code class="ruby"> nyancat = vcr('asset') { client.asset 'nyancat' }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="183">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat).to be_a MyBetterAsset</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="184">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.https_image_url).to start_with 'https'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="185">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="186">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="187">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="188">
- <span class="hits">1</span>
-
- <code class="ruby"> describe ':entry_mapping' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="189">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'lets you register your own entry classes for certain entry types' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="190">
- <span class="hits">1</span>
-
- <code class="ruby"> class Cat < Contentful::Entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="191">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="192">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="193">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="194">
-
-
- <code class="ruby"> entry_mapping: {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="195">
-
-
- <code class="ruby"> 'cat' => Cat</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="196">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="197">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="198">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="199">
- <span class="hits">2</span>
-
- <code class="ruby"> nyancat = vcr('entry') { client.entry 'nyancat' }</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="200">
- <span class="hits">2</span>
-
- <code class="ruby"> finn = vcr('human') { client.entry 'finn' }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="201">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat).to be_a Cat</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="202">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(finn).to be_a Contentful::Entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="203">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="204">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="205">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="206">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'X-Contentful-User-Agent headers' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="207">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'default values' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="208">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="209">
-
-
- <code class="ruby"> "sdk contentful.rb/#{Contentful::VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="210">
-
-
- <code class="ruby"> "platform ruby/#{RUBY_VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="211">
-
-
- <code class="ruby"> ]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="212">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="213">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="214">
- <span class="hits">1</span>
-
- <code class="ruby"> expected.each do |h|</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="215">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="216">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="217">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="218">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="219">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="220">
- <span class="hits">1</span>
-
- <code class="ruby"> ['integration', 'app'].each do |h|</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="221">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="222">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="223">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="224">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="225">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'with integration name only' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="226">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="227">
-
-
- <code class="ruby"> "sdk contentful.rb/#{Contentful::VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="228">
-
-
- <code class="ruby"> "platform ruby/#{RUBY_VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="229">
-
-
- <code class="ruby"> "integration foobar;"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="230">
-
-
- <code class="ruby"> ]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="231">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="232">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(integration_name: 'foobar')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="233">
- <span class="hits">1</span>
-
- <code class="ruby"> expected.each do |h|</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="234">
- <span class="hits">3</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="235">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="236">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="237">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="238">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="239">
- <span class="hits">1</span>
-
- <code class="ruby"> ['app'].each do |h|</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="240">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="241">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="242">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="243">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="244">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'with integration' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="245">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="246">
-
-
- <code class="ruby"> "sdk contentful.rb/#{Contentful::VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="247">
-
-
- <code class="ruby"> "platform ruby/#{RUBY_VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="248">
-
-
- <code class="ruby"> "integration foobar/0.1.0;"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="249">
-
-
- <code class="ruby"> ]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="250">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="251">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(integration_name: 'foobar', integration_version: '0.1.0')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="252">
- <span class="hits">1</span>
-
- <code class="ruby"> expected.each do |h|</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="253">
- <span class="hits">3</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="254">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="255">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="256">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="257">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="258">
- <span class="hits">1</span>
-
- <code class="ruby"> ['app'].each do |h|</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="259">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="260">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="261">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="262">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="263">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'with application name only' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="264">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="265">
-
-
- <code class="ruby"> "sdk contentful.rb/#{Contentful::VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="266">
-
-
- <code class="ruby"> "platform ruby/#{RUBY_VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="267">
-
-
- <code class="ruby"> "app fooapp;"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="268">
-
-
- <code class="ruby"> ]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="269">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="270">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(application_name: 'fooapp')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="271">
- <span class="hits">1</span>
-
- <code class="ruby"> expected.each do |h|</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="272">
- <span class="hits">3</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="273">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="274">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="275">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="276">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="277">
- <span class="hits">1</span>
-
- <code class="ruby"> ['integration'].each do |h|</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="278">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="279">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="280">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="281">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="282">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'with application' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="283">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="284">
-
-
- <code class="ruby"> "sdk contentful.rb/#{Contentful::VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="285">
-
-
- <code class="ruby"> "platform ruby/#{RUBY_VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="286">
-
-
- <code class="ruby"> "app fooapp/1.0.0;"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="287">
-
-
- <code class="ruby"> ]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="288">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="289">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(application_name: 'fooapp', application_version: '1.0.0')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="290">
- <span class="hits">1</span>
-
- <code class="ruby"> expected.each do |h|</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="291">
- <span class="hits">3</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="292">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="293">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="294">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="295">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="296">
- <span class="hits">1</span>
-
- <code class="ruby"> ['integration'].each do |h|</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="297">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="298">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="299">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="300">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="301">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'with all' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="302">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="303">
-
-
- <code class="ruby"> "sdk contentful.rb/#{Contentful::VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="304">
-
-
- <code class="ruby"> "platform ruby/#{RUBY_VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="305">
-
-
- <code class="ruby"> "integration foobar/0.1.0;",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="306">
-
-
- <code class="ruby"> "app fooapp/1.0.0;"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="307">
-
-
- <code class="ruby"> ]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="308">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="309">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="310">
-
-
- <code class="ruby"> integration_name: 'foobar',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="311">
-
-
- <code class="ruby"> integration_version: '0.1.0',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="312">
-
-
- <code class="ruby"> application_name: 'fooapp',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="313">
-
-
- <code class="ruby"> application_version: '1.0.0'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="314">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="315">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="316">
- <span class="hits">1</span>
-
- <code class="ruby"> expected.each do |h|</code>
- </li>
-
- <li class="covered" data-hits="4" data-linenumber="317">
- <span class="hits">4</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="318">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="319">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="320">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="321">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="322">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="323">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'when only version numbers, skips header' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="324">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="325">
-
-
- <code class="ruby"> "sdk contentful.rb/#{Contentful::VERSION};",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="326">
-
-
- <code class="ruby"> "platform ruby/#{RUBY_VERSION};"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="327">
-
-
- <code class="ruby"> ]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="328">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="329">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="330">
-
-
- <code class="ruby"> integration_version: '0.1.0',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="331">
-
-
- <code class="ruby"> application_version: '1.0.0'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="332">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="333">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="334">
- <span class="hits">1</span>
-
- <code class="ruby"> expected.each do |h|</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="335">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="336">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="337">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="338">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).to match(/os (Windows|macOS|Linux)(\/.*)?;/i)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="339">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="340">
- <span class="hits">1</span>
-
- <code class="ruby"> ['integration', 'app'].each do |h|</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="341">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(client.contentful_user_agent).not_to include(h)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="342">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="343">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="344">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="345">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'headers include X-Contentful-User-Agent' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="346">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="347">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client.request_headers['X-Contentful-User-Agent']).to eq client.contentful_user_agent</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="348">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="349">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="350">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="a13ad32dd6d5c02d3772a4dd1d1e6e305b77003e">
- <div class="header">
- <h3>spec/content_type_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>26</b> relevant lines.
- <span class="green"><b>26</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 'spec_helper'</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 Contentful::ContentType do</code>
- </li>
-
- <li class="covered" data-hits="15" data-linenumber="4">
- <span class="hits">15</span>
-
- <code class="ruby"> let(:content_type) { vcr('content_type') { create_client.content_type 'cat' } }</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"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.sys.keys.sample).to be_a Symbol</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="10">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="11">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.id).to eq 'cat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.type).to eq 'ContentType'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</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"> describe 'Properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #name' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.name).to eq 'Cat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="25">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #description' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.description).to eq 'Meow.'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="28">
-
-
- <code class="ruby"> end</code>
- </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"> it 'has #fields' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.fields).to be_a Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="32">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.fields.first).to be_a Contentful::Field</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="33">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="35">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'could have #display_field' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type).to respond_to :display_field</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="37">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="40">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'supports camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('content_type') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> content_type = create_client(use_camel_case: true).content_type 'cat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="45">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type.displayField).to eq 'name'</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>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="4c609b9f8ef04e1d39a0e44d3e7df4e970ef32ed">
- <div class="header">
- <h3>spec/deleted_asset_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>20</b> relevant lines.
- <span class="green"><b>20</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 'spec_helper'</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 'DeletedAsset' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> let(:deleted_asset)do</code>
- </li>
-
- <li class="covered" data-hits="4" data-linenumber="5">
- <span class="hits">4</span>
-
- <code class="ruby"> vcr('sync_deleted_asset')do</code>
- </li>
-
- <li class="covered" data-hits="4" data-linenumber="6">
- <span class="hits">4</span>
-
- <code class="ruby"> create_client.sync(initial: true, type: 'DeletedAsset').first_page.items[0]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="7">
-
-
- <code class="ruby"> end</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="10">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="11">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_asset.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_asset.sys.keys.sample).to be_a Symbol</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_asset.id).to eq '5c6VY0gWg0gwaIeYkUUiqG'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_asset.type).to eq 'DeletedAsset'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #deleted_at' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_asset.created_at).to be_a DateTime</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="28">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="30">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'supports camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_deleted_asset') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="32">
- <span class="hits">1</span>
-
- <code class="ruby"> deleted_asset = create_client(use_camel_case: true).sync(initial: true, type: 'DeletedAsset').first_page.items[0]</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"> expect(deleted_asset.createdAt).to be_a DateTime</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"> }</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="363838f9765468206e180a5461c937dff2f2ee47">
- <div class="header">
- <h3>spec/deleted_entry_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>20</b> relevant lines.
- <span class="green"><b>20</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 'spec_helper'</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 'DeletedEntry' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> let(:deleted_entry)do</code>
- </li>
-
- <li class="covered" data-hits="4" data-linenumber="5">
- <span class="hits">4</span>
-
- <code class="ruby"> vcr('sync_deleted_entry')do</code>
- </li>
-
- <li class="covered" data-hits="4" data-linenumber="6">
- <span class="hits">4</span>
-
- <code class="ruby"> create_client.sync(initial: true, type: 'DeletedEntry').first_page.items[0]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="7">
-
-
- <code class="ruby"> end</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="10">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="11">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_entry.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_entry.sys.keys.sample).to be_a Symbol</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_entry.id).to eq 'CVebBDcQsSsu6yKKIayy'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_entry.type).to eq 'DeletedEntry'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #deleted_at' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(deleted_entry.created_at).to be_a DateTime</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="28">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="30">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'supports camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_deleted_entry') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="32">
- <span class="hits">1</span>
-
- <code class="ruby"> deleted_entry = create_client(use_camel_case: true).sync(initial: true, type: 'DeletedEntry').first_page.items[0]</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"> expect(deleted_entry.createdAt).to be_a DateTime</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"> }</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="b9d994cc83de1652f7c9126b34ef4d10041b9da0">
- <div class="header">
- <h3>spec/entry_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>253</b> relevant lines.
- <span class="green"><b>253</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 'spec_helper'</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 Contentful::Entry do</code>
- </li>
-
- <li class="covered" data-hits="25" data-linenumber="4">
- <span class="hits">25</span>
-
- <code class="ruby"> let(:entry) { vcr('entry') { create_client.entry 'nyancat' } }</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"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.sys.keys.sample).to be_a Symbol</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="10">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="11">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.id).to eq 'nyancat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.type).to eq 'Entry'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #space' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.space).to be_a Contentful::Link</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #content_type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.content_type).to be_a Contentful::Link</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #created_at' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.created_at).to be_a DateTime</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"> it 'has #updated_at' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.updated_at).to be_a DateTime</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #revision' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.revision).to eq 5</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Fields' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #fields getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="44">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.sys.keys.sample).to be_a Symbol</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="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> it "contains the entry's fields" do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="48">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields[:color]).to eq 'rainbow'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="49">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields[:best_friend]).to be_a Contentful::Entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="51">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="52">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'multiple locales' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="54">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can handle multiple locales' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="55">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry_locales') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> nyancat = create_client.entries(locale: "*", 'sys.id' => 'nyancat').items.first</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields('en-US')[:name]).to eq "Nyan Cat"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="58">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields('tlh')[:name]).to eq "Nyan vIghro'"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="59">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields(:'en-US')[:name]).to eq "Nyan Cat"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="62">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields(:tlh)[:name]).to eq "Nyan vIghro'"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="63">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="64">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="65">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="66">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#fields_with_locales' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="67">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can handle entries with just 1 locale' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="68">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="69">
- <span class="hits">1</span>
-
- <code class="ruby"> nyancat = create_client.entry('nyancat')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="70">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields_with_locales[:name].size).to eq(1)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="71">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields_with_locales[:name][:'en-US']).to eq("Nyan Cat")</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="72">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="73">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="74">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="75">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can handle entries with multiple locales' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="76">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry_locales') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="77">
- <span class="hits">1</span>
-
- <code class="ruby"> nyancat = create_client.entries(locale: "*", 'sys.id' => 'nyancat').items.first</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="78">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields_with_locales[:name].size).to eq(2)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="79">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields_with_locales[:name][:'en-US']).to eq("Nyan Cat")</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="80">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.fields_with_locales[:name][:tlh]).to eq("Nyan vIghro'")</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="81">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="82">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="83">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="84">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can have references in multiple locales and they are properly solved' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="85">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('multi_locale_reference') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="86">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="87">
-
-
- <code class="ruby"> space: '1sjfpsn7l90g',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="88">
-
-
- <code class="ruby"> access_token: 'e451a3cdfced9000220be41ed9c899866e8d52aa430eaf7c35b09df8fc6326f9',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="89">
-
-
- <code class="ruby"> dynamic_entries: :auto</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="90">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="91">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="92">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries(locale: '*').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="93">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="94">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.image).to be_a ::Contentful::Asset</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="95">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields('zh')[:image]).to be_a ::Contentful::Asset</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="96">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields('es')[:image]).to be_a ::Contentful::Asset</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="97">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="98">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.image.id).not_to eq entry.fields('zh')[:image].id</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="99">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="100">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="101">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="102">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can have references with arrays in multiple locales and have them properly solved' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="103">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('multi_locale_array_reference') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="104">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="105">
-
-
- <code class="ruby"> space: 'cma9f9g4dxvs',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="106">
-
-
- <code class="ruby"> access_token: '3e4560614990c9ac47343b9eea762bdaaebd845766f619660d7230787fd545e1',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="107">
-
-
- <code class="ruby"> dynamic_entries: :auto</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="108">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="109">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="110">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries(content_type: 'test', locale: '*').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="111">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="112">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.files).to be_a ::Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="113">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.references).to be_a ::Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="114">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.files.first).to be_a ::Contentful::Asset</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="115">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.references.first.entry?).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="116">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="117">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields('zh')[:files]).to be_a ::Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="118">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields('zh')[:references]).to be_a ::Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="119">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields('zh')[:files].first).to be_a ::Contentful::Asset</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="120">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields('zh')[:references].first.entry?).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="121">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="122">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.files.first.id).not_to eq entry.fields('zh')[:files].first.id</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="123">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="124">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="125">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="126">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="127">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="128">
- <span class="hits">1</span>
-
- <code class="ruby"> it '#raw' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="129">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/raw') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="130">
- <span class="hits">1</span>
-
- <code class="ruby"> nyancat = create_client.entry('nyancat')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="131">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(nyancat.raw).to eq(create_client(raw_mode: true).entry('nyancat').object['items'].first)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="132">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="133">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="134">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="135">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'can be marshalled' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="136">
- <span class="hits">1</span>
-
- <code class="ruby"> def test_dump(nyancat)</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="137">
- <span class="hits">2</span>
-
- <code class="ruby"> dump = Marshal.dump(nyancat)</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="138">
- <span class="hits">2</span>
-
- <code class="ruby"> new_cat = Marshal.load(dump)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="139">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="140">
-
-
- <code class="ruby"> # Attributes</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="141">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat).to be_a Contentful::Entry</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="142">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.name).to eq "Nyan Cat"</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="143">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.lives).to eq 1337</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="144">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="145">
-
-
- <code class="ruby"> # Single linked objects</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="146">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.best_friend).to be_a Contentful::Entry</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="147">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.best_friend.name).to eq "Happy Cat"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="148">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="149">
-
-
- <code class="ruby"> # Array of linked objects</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="150">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.cat_pack.count).to eq 2</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="151">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.cat_pack[0].name).to eq "Happy Cat"</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="152">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.cat_pack[1].name).to eq "Worried Cat"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="153">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="154">
-
-
- <code class="ruby"> # Nested Links</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="155">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.best_friend.best_friend).to be_a Contentful::Entry</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="156">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.best_friend.best_friend.name).to eq "Nyan Cat"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="157">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="158">
-
-
- <code class="ruby"> # Asset</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="159">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(new_cat.image.file.url).to eq "//images.contentful.com/cfexampleapi/4gp6taAwW4CmSgumq2ekUm/9da0cd1936871b8d72343e895a00d611/Nyan_cat_250px_frame.png"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="160">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="161">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="162">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'marshals properly' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="163">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/marshall') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="164">
- <span class="hits">1</span>
-
- <code class="ruby"> nyancat = create_client(gzip_encoded: false, max_include_resolution_depth: 2).entries(include: 2, 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="165">
- <span class="hits">1</span>
-
- <code class="ruby"> test_dump(nyancat)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="166">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="167">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="168">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="169">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can remarshall an unmarshalled object' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="170">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/marshall') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="171">
- <span class="hits">1</span>
-
- <code class="ruby"> nyancat = create_client(max_include_resolution_depth: 2).entries(include: 2, 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="172">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="173">
-
-
- <code class="ruby"> # The double load/dump is on purpose</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="174">
- <span class="hits">1</span>
-
- <code class="ruby"> test_dump(Marshal.load(Marshal.dump(nyancat)))</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="175">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="176">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="177">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="178">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can properly marshal multiple level nested resources - #138' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="179">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/marshal_138') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="180">
- <span class="hits">1</span>
-
- <code class="ruby"> parent = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="181">
-
-
- <code class="ruby"> space: 'j8tb59fszch7',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="182">
-
-
- <code class="ruby"> access_token: '5f711401f965951eb724ac72ac905e13d892294ba209268f13a9b32e896c8694',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="183">
-
-
- <code class="ruby"> dynamic_entries: :auto,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="184">
-
-
- <code class="ruby"> max_include_resolution_depth: 5</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="185">
-
-
- <code class="ruby"> ).entry('5aV3O0l5jU0cwQ2OkyYsyU')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="186">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="187">
- <span class="hits">1</span>
-
- <code class="ruby"> rehydrated = Marshal.load(Marshal.dump(parent))</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="188">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="189">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(rehydrated.childs.first.image1.url).to eq '//images.contentful.com/j8tb59fszch7/7FjliblAmAoGMwU62MeQ6k/62509df90ef4bed38c0701bb9aa8c74c/Funny-Cat-Pictures-with-Captions-25.jpg'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="190">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(rehydrated.childs.first.image2.url).to eq '//images.contentful.com/j8tb59fszch7/1pbGuWZ27O6GMO0OGemgcA/a4185036a3640ad4491f38d8926003ab/Funny-Cat-Pictures-with-Captions-1.jpg'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="191">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(rehydrated.childs.last.image1.url).to eq '//images.contentful.com/j8tb59fszch7/4SXVTr0KEUyWiMMCOaUeUU/c9fa2246d5529a9c8e1ec6f5387dc4f6/e0194eca1c8135636ce0e014341548c3.jpg'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="192">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(rehydrated.childs.last.image2.url).to eq '//images.contentful.com/j8tb59fszch7/1NU1YcNQJGIA22gAKmKqWo/56fa672bb17a7b7ae2773d08e101d059/57ee64921c25faa649fc79288197c313.jpg'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="193">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="194">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="195">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="196">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="197">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'incoming links' do</code>
- </li>
-
- <li class="covered" data-hits="4" data-linenumber="198">
- <span class="hits">4</span>
-
- <code class="ruby"> let(:client) { create_client }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="199">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="200">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will fetch entries referencing the entry using a query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="201">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/search_link_to_entry') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="202">
- <span class="hits">1</span>
-
- <code class="ruby"> entries = client.entries(links_to_entry: 'nyancat')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="203">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries).not_to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="204">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.count).to eq 1</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="205">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.first.id).to eq 'happycat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="206">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="207">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="208">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="209">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will fetch entries referencing the entry using instance method' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="210">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/search_link_to_entry') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="211">
- <span class="hits">1</span>
-
- <code class="ruby"> entries = entry.incoming_references client</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="212">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries).not_to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="213">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.count).to eq 1</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="214">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.first.id).to eq 'happycat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="215">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="216">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="217">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="218">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will fetch entries referencing the entry using instance method + query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="219">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/search_link_to_entry_with_custom_query') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="220">
- <span class="hits">1</span>
-
- <code class="ruby"> entries = entry.incoming_references(client, { content_type: 'cat', select: ['fields.name'] })</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="221">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries).not_to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="222">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.count).to eq 1</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="223">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.first.id).to eq 'happycat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="224">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entries.first.fields.keys).to eq([:name])</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="225">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="226">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="227">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="228">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="229">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="230">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'select operator' do</code>
- </li>
-
- <li class="covered" data-hits="6" data-linenumber="231">
- <span class="hits">6</span>
-
- <code class="ruby"> let(:client) { create_client }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="232">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="233">
- <span class="hits">1</span>
-
- <code class="ruby"> context 'with sys sent' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="234">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'properly creates an entry' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="235">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/select_only_sys') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="236">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries(select: ['sys'], 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="237">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields).to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="238">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.entry?).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="239">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="240">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="241">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="242">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'can contain only one field' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="243">
- <span class="hits">1</span>
-
- <code class="ruby"> context 'with content_type sent' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="244">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will properly create the entry with one field' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="245">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/select_one_field_proper') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="246">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries(content_type: 'cat', select: ['sys', 'fields.name'], 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="247">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields).not_to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="248">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.entry?).to be_truthy</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="249">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields[:name]).to eq 'Nyan Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="250">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.fields).to eq({name: 'Nyan Cat'})</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="251">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="252">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="253">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="254">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="255">
- <span class="hits">1</span>
-
- <code class="ruby"> context 'without content_type sent' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="256">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will raise an error' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="257">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/select_one_field') {</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="258">
- <span class="hits">2</span>
-
- <code class="ruby"> expect { client.entries(select: ['sys', 'fields.name'], 'sys.id' => 'nyancat') }.to raise_error Contentful::BadRequest</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="259">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="260">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="261">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="262">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="263">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="264">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="265">
- <span class="hits">1</span>
-
- <code class="ruby"> context 'without sys sent' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="266">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will enforce sys anyway' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="267">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/select_no_sys') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="268">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries(select: ['fields'], 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="269">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="270">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.id).to eq 'nyancat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="271">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.sys).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="272">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="273">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="274">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="275">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'works with empty array as well, as sys is enforced' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="276">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/select_empty_array') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="277">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries(select: [], 'sys.id' => 'nyancat').first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="278">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="279">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.id).to eq 'nyancat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="280">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.sys).not_to be_empty</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="281">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="282">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="283">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="284">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="285">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="286">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'reuse objects' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="287">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'should handle recursion as well as not reusing' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="288">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/include_resolution') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="289">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client(reuse_objects: true).entry('nyancat', include: 2)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="290">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="291">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.best_friend.name).to eq 'Happy Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="292">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="293">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="294">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="295">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="296">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="297">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="298">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="299">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="300">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="301">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="302">
-
-
- <code class="ruby"> .best_friend.best_friend.name).to eq 'Nyan Cat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="303">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="304">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="305">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'should use the same object for the same entry' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="306">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/include_resolution') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="307">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client(reuse_entries: true).entry('nyancat', include: 2)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="308">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="309">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.best_friend.name).to eq 'Happy Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="310">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.best_friend.best_friend).to be(entry)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="311">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="312">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="313">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'works on nested structures with unique objects' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="314">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/include_resolution_uniques') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="315">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="316">
-
-
- <code class="ruby"> space: 'v7cxgyxt0w5x',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="317">
-
-
- <code class="ruby"> access_token: '96e5d256e9a5349ce30e84356597e409f8f1bb485cb4719285b555e0f78aa27e',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="318">
-
-
- <code class="ruby"> reuse_entries: true</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="319">
-
-
- <code class="ruby"> ).entry('1nLXjjWvk4MEeWeQCWmymc', include: 10)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="320">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="321">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.title).to eq '1'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="322">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="323">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="324">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="325">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="326">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="327">
-
-
- <code class="ruby"> .child.title).to eq '10'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="328">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="329">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="330">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="331">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="332">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="333">
-
-
- <code class="ruby"> .child.child.title).to eq '1'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="334">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="335">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="336">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="337">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="338">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="339">
-
-
- <code class="ruby"> .child.child.child.child.title).to eq '1'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="340">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="341">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="342">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="343">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="344">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'include resolution' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="345">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'should not reuse objects by default' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="346">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/include_resolution') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="347">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client.entry('nyancat', include: 2)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="348">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="349">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.best_friend.name).to eq 'Happy Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="350">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.best_friend.best_friend).not_to be(entry)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="351">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="352">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="353">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'defaults to 20 depth' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="354">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/include_resolution') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="355">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client.entry('nyancat', include: 2)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="356">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="357">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.best_friend.name).to eq 'Happy Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="358">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="359">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="360">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="361">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="362">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="363">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="364">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="365">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="366">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="367">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="368">
-
-
- <code class="ruby"> .best_friend.best_friend.name).to eq 'Nyan Cat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="369">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="370">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="371">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="372">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="373">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="374">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="375">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="376">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="377">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="378">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="379">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="380">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="381">
-
-
- <code class="ruby"> .best_friend).to be_a ::Contentful::Link</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="382">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="383">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="384">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="385">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can be configured arbitrarily' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="386">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/include_resolution') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="387">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client(max_include_resolution_depth: 3).entry('nyancat', include: 2)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="388">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="389">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.best_friend.name).to eq 'Happy Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="390">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="391">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="392">
-
-
- <code class="ruby"> .best_friend.name).to eq 'Happy Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="393">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="394">
-
-
- <code class="ruby"> .best_friend.best_friend</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="395">
-
-
- <code class="ruby"> .best_friend.best_friend).to be_a ::Contentful::Link</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="396">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="397">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="398">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'works on nested structures with unique objects' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="399">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry/include_resolution_uniques') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="400">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="401">
-
-
- <code class="ruby"> space: 'v7cxgyxt0w5x',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="402">
-
-
- <code class="ruby"> access_token: '96e5d256e9a5349ce30e84356597e409f8f1bb485cb4719285b555e0f78aa27e',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="403">
-
-
- <code class="ruby"> ).entry('1nLXjjWvk4MEeWeQCWmymc', include: 10)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="404">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="405">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.title).to eq '1'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="406">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="407">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="408">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="409">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="410">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="411">
-
-
- <code class="ruby"> .child.title).to eq '10'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="412">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="413">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="414">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="415">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="416">
-
-
- <code class="ruby"> .child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="417">
-
-
- <code class="ruby"> .child.child.title).to eq '1'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="418">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="419">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="420">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="421">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="422">
-
-
- <code class="ruby"> .child.child.child.child</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="423">
-
-
- <code class="ruby"> .child.child.child.child.title).to eq '1'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="424">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="425">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="426">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="427">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="428">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'issues' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="429">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'Symbol/Text field with null values should be serialized as nil - #117' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="430">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entries/issue_117') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="431">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(space: '8jbbayggj9gj', access_token: '4ce0108f04e55c76476ba84ab0e6149734db73d67cd1b429323ef67f00977e07')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="432">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="433">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="434">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.nil).to be_nil</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="435">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.nil).not_to eq ''</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="436">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="437">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="438">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="439">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'JSON Fields should not be treated as locale data - #96' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="440">
- <span class="hits">1</span>
-
- <code class="ruby"> before do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="441">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('entry/json_objects_client') {</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="442">
- <span class="hits">2</span>
-
- <code class="ruby"> @client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="443">
-
-
- <code class="ruby"> space: 'h425t6gef30p',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="444">
-
-
- <code class="ruby"> access_token: '278f7aa72f2eb90c0e002d60f85bf2144c925acd2d37dd990d3ca274f25076cf',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="445">
-
-
- <code class="ruby"> dynamic_entries: :auto</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="446">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="447">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="448">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="449">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('entry/json_objects') {</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="450">
- <span class="hits">2</span>
-
- <code class="ruby"> @entry = @client.entries.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="451">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="452">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="453">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="454">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'only has default locale' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="455">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(@entry.locales).to eq ['en-US']</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="456">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="457">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="458">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can obtain all values properly' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="459">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(@entry.name).to eq('Test')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="460">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(@entry.object_test).to eq({</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="461">
-
-
- <code class="ruby"> null: nil,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="462">
-
-
- <code class="ruby"> text: 'some text',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="463">
-
-
- <code class="ruby"> array: [1, 2, 3],</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="464">
-
-
- <code class="ruby"> number: 123,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="465">
-
-
- <code class="ruby"> boolean: true,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="466">
-
-
- <code class="ruby"> object: {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="467">
-
-
- <code class="ruby"> null: nil,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="468">
-
-
- <code class="ruby"> text: 'bar',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="469">
-
-
- <code class="ruby"> array: [1, 2, 3],</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="470">
-
-
- <code class="ruby"> number: 123,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="471">
-
-
- <code class="ruby"> boolean: false,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="472">
-
-
- <code class="ruby"> object: {foo: 'bar'}</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="473">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="474">
-
-
- <code class="ruby"> })</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="475">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="476">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="477">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="478">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'Number (Integer and Decimal) values get properly serialized - #125' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="479">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entries/issue_125') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="480">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(space: 'zui87wsu8q80', access_token: '64ff902c58cd14ea063d3ded810d1111a0266537e9aba283bad3319b1762c302', dynamic_entries: :auto)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="481">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entries.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="482">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="483">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.integer).to eq 123</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="484">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.decimal).to eq 12.3</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="485">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="486">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="487">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="488">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'unresolvable entries get filtered from results' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="489">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entries/unresolvable_filter') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="490">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(space: '011npgaszg5o', access_token: '42c9d93410a7319e9a735671fc1e415348f65e94a99fc768b70a7c649859d4fd', dynamic_entries: :auto)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="491">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entry('1HR1QvURo4MoSqO0eqmUeO')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="492">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="493">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.modules.size).to eq 2</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="494">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="495">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="496">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="497">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'unresolvable entries get filtered from results in deeply nested objects - #177' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="498">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entries/unresolvable_filter_deeply_nested') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="499">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(space: 'z471hdso7l1a', access_token: '8a0e09fe71f1cb41e8788ace86a8c8d9d084599fe43a40070f232045014d2585', dynamic_entries: :auto)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="500">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = client.entry('1hb8sipClkQ8ggeGaeSQWm', include: 3)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="501">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.should_published.first.should_unpublished.size).to eq 0</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="502">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="503">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="504">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="505">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="506">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="507">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'supports camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="508">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="509">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client(use_camel_case: true).entry 'nyancat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="510">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="511">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.bestFriend.name).to eq 'Happy Cat'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="512">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(entry.createdAt).to be_a DateTime</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="513">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="514">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="515">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="516">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="517">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'structured text support' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="518">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'properly serializes and resolves includes' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="519">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entries/structured_text') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="520">
- <span class="hits">1</span>
-
- <code class="ruby"> entry = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="521">
-
-
- <code class="ruby"> space: 'jd7yc4wnatx3',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="522">
-
-
- <code class="ruby"> access_token: '6256b8ef7d66805ca41f2728271daf27e8fa6055873b802a813941a0fe696248',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="523">
-
-
- <code class="ruby"> raise_errors: true,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="524">
-
-
- <code class="ruby"> dynamic_entries: :auto</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="525">
-
-
- <code class="ruby"> ).entry('4BupPSmi4M02m0U48AQCSM')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="526">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="527">
- <span class="hits">1</span>
-
- <code class="ruby"> expected_entry_occurrances = 2</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="528">
- <span class="hits">1</span>
-
- <code class="ruby"> embedded_entry_index = 1</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="529">
- <span class="hits">1</span>
-
- <code class="ruby"> entry.body['content'].each do |content|</code>
- </li>
-
- <li class="covered" data-hits="16" data-linenumber="530">
- <span class="hits">16</span>
-
- <code class="ruby"> if content['nodeType'] == 'embedded-entry-block'</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="531">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(content['data']).to be_a Contentful::Entry</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="532">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(content['data'].body).to eq "Embedded #{embedded_entry_index}"</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="533">
- <span class="hits">2</span>
-
- <code class="ruby"> expected_entry_occurrances -= 1</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="534">
- <span class="hits">2</span>
-
- <code class="ruby"> embedded_entry_index += 1</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="535">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="536">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="537">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="538">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(expected_entry_occurrances).to eq 0</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="539">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="540">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="541">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="542">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="ba5ec4bdbf6ab50e064edb4d1e274e870b307f6e">
- <div class="header">
- <h3>spec/error_class_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>151</b> relevant lines.
- <span class="green"><b>151</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 'spec_helper'</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 Contentful::Error do</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="4">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:r) { Contentful::Response.new raw_fixture('not_found', 404) }</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"> describe '#response' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns the response the error has been initialized with' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error.new(r).response).to be r</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="11">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#message' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns the message found in the response json' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="14">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 404\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"> "Message: The resource could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="16">
-
-
- <code class="ruby"> "Details: {\"type\"=>\"Entry\", \"space\"=>\"cfexampleapi\", \"id\"=>\"not found\"}\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="18">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error.new(r).message).not_to be_nil</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error.new(r).message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="20">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="21">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'message types' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'default messages' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> it '400' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_400', 400)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 400\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="29">
-
-
- <code class="ruby"> "Message: The request was malformed or missing a required parameter.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="30">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="34">
- <span class="hits">1</span>
-
- <code class="ruby"> it '401' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="35">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_401', 401)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</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"> message = "HTTP status code: 401\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"> "Message: The authorization token was invalid.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="42">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="43">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="44">
- <span class="hits">1</span>
-
- <code class="ruby"> it '403' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="45">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_403', 403)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="47">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="48">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 403\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"> "Message: The specified token does not have access to the requested resource.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="51">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="52">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="53">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="54">
- <span class="hits">1</span>
-
- <code class="ruby"> it '404' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="55">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_404', 404)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="57">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="58">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 404\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="59">
-
-
- <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="62">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="63">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="64">
- <span class="hits">1</span>
-
- <code class="ruby"> it '429' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="65">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_429', 429)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="66">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="67">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="68">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 429\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="69">
-
-
- <code class="ruby"> "Message: Rate limit exceeded. Too many requests.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="70">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="71">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="72">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="73">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="74">
- <span class="hits">1</span>
-
- <code class="ruby"> it '500' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="75">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_500', 500)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="76">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="77">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="78">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 500\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="79">
-
-
- <code class="ruby"> "Message: Internal server error.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="80">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="81">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="82">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="83">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="84">
- <span class="hits">1</span>
-
- <code class="ruby"> it '502' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="85">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_502', 502)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="86">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="87">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="88">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 502\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="89">
-
-
- <code class="ruby"> "Message: The requested space is hibernated.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="90">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="91">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="92">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="93">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="94">
- <span class="hits">1</span>
-
- <code class="ruby"> it '503' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="95">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_503', 503)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="96">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="97">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="98">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 503\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="99">
-
-
- <code class="ruby"> "Message: The request was malformed or missing a required parameter.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="100">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="101">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="102">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="103">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="104">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="105">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'special cases' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="106">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '400' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="107">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'details is a string' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="108">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('400_details_string', 400)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="109">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="110">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="111">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 400\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="112">
-
-
- <code class="ruby"> "Message: The request was malformed or missing a required parameter.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="113">
-
-
- <code class="ruby"> "Details: some error\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="114">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="115">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="116">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="117">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="118">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'details is an object, internal errors are strings' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="119">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('400_details_errors_string', 400)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="120">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="121">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="122">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 400\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="123">
-
-
- <code class="ruby"> "Message: The request was malformed or missing a required parameter.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="124">
-
-
- <code class="ruby"> "Details: some error\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="125">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="126">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="127">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="128">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="129">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'details is an object, internal errors are objects which have details' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="130">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('400_details_errors_object', 400)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="131">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="132">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="133">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 400\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="134">
-
-
- <code class="ruby"> "Message: The request was malformed or missing a required parameter.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="135">
-
-
- <code class="ruby"> "Details: some error\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="136">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="137">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="138">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="139">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="140">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="141">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '403' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="142">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has an array of reasons' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="143">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('403_reasons', 403)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="144">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="145">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="146">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 403\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="147">
-
-
- <code class="ruby"> "Message: The specified token does not have access to the requested resource.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="148">
-
-
- <code class="ruby"> "Details: \n\tReasons:\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="149">
-
-
- <code class="ruby"> "\t\tfoo\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="150">
-
-
- <code class="ruby"> "\t\tbar\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="151">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="152">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="153">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="154">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="155">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="156">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '404' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="157">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'details is a string' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="158">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('404_details_string', 404)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="159">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="160">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="161">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 404\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="162">
-
-
- <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="163">
-
-
- <code class="ruby"> "Details: The resource could not be found\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="164">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="165">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="166">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="167">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="168">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'has a type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="169">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'type is on the top level' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="170">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('404_type', 404)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="171">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="172">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="173">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 404\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="174">
-
-
- <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="175">
-
-
- <code class="ruby"> "Details: The requested Asset could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="176">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="177">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="178">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="179">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="180">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'type is not on the top level' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="181">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('404_sys_type', 404)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="182">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="183">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="184">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 404\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="185">
-
-
- <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="186">
-
-
- <code class="ruby"> "Details: The requested Space could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="187">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="188">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="189">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="190">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="191">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="192">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can specify the resource id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="193">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('404_id', 404)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="194">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="195">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="196">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 404\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="197">
-
-
- <code class="ruby"> "Message: The requested resource or endpoint could not be found.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="198">
-
-
- <code class="ruby"> "Details: The requested Asset could not be found. ID: foobar.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="199">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="200">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="201">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="202">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="203">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="204">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '429' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="205">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can show the time until reset' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="206">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('default_429', 429, false, {'x-contentful-ratelimit-reset' => 60})</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="207">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="208">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="209">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 429\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="210">
-
-
- <code class="ruby"> "Message: Rate limit exceeded. Too many requests.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="211">
-
-
- <code class="ruby"> "Request ID: 85f-351076632\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="212">
-
-
- <code class="ruby"> "Time until reset (seconds): 60"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="213">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="214">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="215">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="216">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="217">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="218">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'generic error' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="219">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'with everything' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="220">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('other_error', 512)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="221">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="222">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="223">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 512\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="224">
-
-
- <code class="ruby"> "Message: Some error occurred.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="225">
-
-
- <code class="ruby"> "Details: some text\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="226">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="227">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="228">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="229">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="230">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'no details' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="231">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_details', 512)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="232">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="233">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="234">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 512\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="235">
-
-
- <code class="ruby"> "Message: Some error occurred.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="236">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="237">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="238">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="239">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="240">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'no request id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="241">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_request_id', 512)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="242">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="243">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="244">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 512\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="245">
-
-
- <code class="ruby"> "Message: Some error occurred.\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="246">
-
-
- <code class="ruby"> "Details: some text"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="247">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="248">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="249">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="250">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'no message' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="251">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_no_message', 512)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="252">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="253">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="254">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 512\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="255">
-
-
- <code class="ruby"> "Message: The following error was received: {\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="256">
-
-
- <code class="ruby"> " \"sys\": {\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="257">
-
-
- <code class="ruby"> " \"type\": \"Error\",\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="258">
-
-
- <code class="ruby"> " \"id\": \"SomeError\"\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="259">
-
-
- <code class="ruby"> " },\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="260">
-
-
- <code class="ruby"> " \"details\": \"some text\",\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="261">
-
-
- <code class="ruby"> " \"requestId\": \"85f-351076632\"\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="262">
-
-
- <code class="ruby"> "}\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="263">
-
-
- <code class="ruby"> "\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="264">
-
-
- <code class="ruby"> "Details: some text\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="265">
-
-
- <code class="ruby"> "Request ID: 85f-351076632"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="266">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="267">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="268">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="269">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'nothing' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="270">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new raw_fixture('other_error_nothing', 512)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="271">
- <span class="hits">1</span>
-
- <code class="ruby"> error = Contentful::Error[response.raw.status].new(response)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="272">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="273">
- <span class="hits">1</span>
-
- <code class="ruby"> message = "HTTP status code: 512\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="274">
-
-
- <code class="ruby"> "Message: The following error was received: {\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="275">
-
-
- <code class="ruby"> " \"sys\": {\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="276">
-
-
- <code class="ruby"> " \"type\": \"Error\",\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="277">
-
-
- <code class="ruby"> " \"id\": \"SomeError\"\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="278">
-
-
- <code class="ruby"> " }\n"\</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="279">
-
-
- <code class="ruby"> "}\n"</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="280">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error.message).to eq message</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="281">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="282">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="283">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="284">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="285">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="286">
- <span class="hits">1</span>
-
- <code class="ruby"> describe Contentful::UnparsableJson do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="287">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#message' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="288">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns the json parser\'s message' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="289">
- <span class="hits">1</span>
-
- <code class="ruby"> uj = Contentful::Response.new raw_fixture('unparsable')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="290">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::UnparsableJson.new(uj).message).to \</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="291">
-
-
- <code class="ruby"> include 'unexpected token'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="292">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="293">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="294">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="295">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="296">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '.[]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="297">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns BadRequest error class for 400' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="298">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[400]).to eq Contentful::BadRequest</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="299">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="300">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="301">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns Unauthorized error class for 401' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="302">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[401]).to eq Contentful::Unauthorized</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="303">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="304">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="305">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns AccessDenied error class for 403' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="306">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[403]).to eq Contentful::AccessDenied</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="307">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="308">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="309">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns NotFound error class for 404' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="310">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[404]).to eq Contentful::NotFound</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="311">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="312">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="313">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns ServerError error class for 500' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="314">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[500]).to eq Contentful::ServerError</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="315">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="316">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="317">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns ServiceUnavailable error class for 503' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="318">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[503]).to eq Contentful::ServiceUnavailable</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="319">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="320">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="321">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns generic error class for any other value' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="322">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[nil]).to eq Contentful::Error</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="323">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(Contentful::Error[200]).to eq Contentful::Error</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="324">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="325">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="326">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="327">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="a882eb4cc91a2c1702f2e5743aba55a06bbc06f0">
- <div class="header">
- <h3>spec/error_requests_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>44</b> relevant lines.
- <span class="green"><b>44</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 'spec_helper'</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">class NonCachingClient < Contentful::Client</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> def request_headers</code>
- </li>
-
- <li class="covered" data-hits="8" data-linenumber="5">
- <span class="hits">8</span>
-
- <code class="ruby"> headers = super</code>
- </li>
-
- <li class="covered" data-hits="8" data-linenumber="6">
- <span class="hits">8</span>
-
- <code class="ruby"> headers['Cf-No-Cache'] = 'foobar'</code>
- </li>
-
- <li class="covered" data-hits="8" data-linenumber="7">
- <span class="hits">8</span>
-
- <code class="ruby"> headers</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>
-
- <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">class RetryLoggerMock < Logger</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> attr_reader :retry_attempts</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 initialize(*)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> super</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> @retry_attempts = 0</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> def info(message)</code>
- </li>
-
- <li class="covered" data-hits="5" data-linenumber="20">
- <span class="hits">5</span>
-
- <code class="ruby"> super</code>
- </li>
-
- <li class="covered" data-hits="5" data-linenumber="21">
- <span class="hits">5</span>
-
- <code class="ruby"> @retry_attempts += 1 if message.include?('Contentful API Rate Limit Hit! Retrying')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby">end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby">describe 'Error Requests' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return 404 (Unauthorized) if resource not found' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> expect_vcr('not found')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> create_client.content_type 'not found'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="29">
-
-
- <code class="ruby"> end.to raise_error(Contentful::NotFound)</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"> it 'will return 400 (BadRequest) if invalid parameters have been passed' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
-
- <code class="ruby"> expect_vcr('bad request')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="34">
- <span class="hits">1</span>
-
- <code class="ruby"> create_client.entries(some: 'parameter')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"> end.to raise_error(Contentful::BadRequest)</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"> it 'will return 403 (AccessDenied) if ...' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="39">
- <span class="hits">1</span>
-
- <code class="ruby"> skip</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="41">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return 401 (Unauthorized) if wrong credentials are given' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> client = Contentful::Client.new(space: 'wrong', access_token: 'credentials')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="45">
- <span class="hits">1</span>
-
- <code class="ruby"> expect_vcr('unauthorized'){</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> client.entry('nyancat')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="47">
-
-
- <code class="ruby"> }.to raise_error(Contentful::Unauthorized)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="50">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return 500 (ServerError) if ...' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="51">
- <span class="hits">1</span>
-
- <code class="ruby"> skip</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="52">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="53">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="54">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return a 429 if the ratelimit is reached and is not set to retry' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="55">
- <span class="hits">1</span>
-
- <code class="ruby"> client = Contentful::Client.new(space: 'wrong', access_token: 'credentials', max_rate_limit_retries: 0)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> expect_vcr('ratelimit') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> client.entry('nyancat')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="58">
-
-
- <code class="ruby"> }.to raise_error(Contentful::RateLimitExceeded)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="59">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will retry on 429 by default' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="62">
- <span class="hits">1</span>
-
- <code class="ruby"> logger = RetryLoggerMock.new(STDOUT)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="63">
- <span class="hits">1</span>
-
- <code class="ruby"> client = NonCachingClient.new(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="64">
-
-
- <code class="ruby"> api_url: 'cdnorigin.flinkly.com',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="65">
-
-
- <code class="ruby"> space: '164vhtp008kz',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="66">
-
-
- <code class="ruby"> access_token: '7699b6c6f6cee9b6abaa216c71fbcb3eee56cb6f082f57b5e21b2b50f86bdea0',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="67">
-
-
- <code class="ruby"> raise_errors: true,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="68">
-
-
- <code class="ruby"> logger: logger</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="69">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="70">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="71">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('ratelimit_retry') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="72">
- <span class="hits">1</span>
-
- <code class="ruby"> 3.times {</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="73">
- <span class="hits">3</span>
-
- <code class="ruby"> client.assets</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="74">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="75">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="76">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="77">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(logger.retry_attempts).to eq 1</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="78">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="79">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="80">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return 503 (ServiceUnavailable) when the service is unavailable' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="81">
- <span class="hits">1</span>
-
- <code class="ruby"> client = Contentful::Client.new(space: 'wrong', access_token: 'credentials')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="82">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="83">
- <span class="hits">1</span>
-
- <code class="ruby"> expect_vcr('unavailable'){</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="84">
- <span class="hits">1</span>
-
- <code class="ruby"> client.entry('nyancat')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="85">
-
-
- <code class="ruby"> }.to raise_error(Contentful::ServiceUnavailable)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="86">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="87">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="60501d65433b1709942162aa7e81098ef5f8d6cc">
- <div class="header">
- <h3>spec/field_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>52</b> relevant lines.
- <span class="green"><b>52</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 'spec_helper'</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 Contentful::Field do</code>
- </li>
-
- <li class="covered" data-hits="13" data-linenumber="4">
- <span class="hits">13</span>
-
- <code class="ruby"> let(:field) { vcr('field') { create_client.content_type('cat').fields.first } }</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="5">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:linkField) { vcr('linkField') {</code>
- </li>
-
- <li class="covered" data-hits="18" data-linenumber="6">
- <span class="hits">18</span>
-
- <code class="ruby"> create_client.content_type('cat').fields.select { |f| f.id == 'image' }.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="7">
-
-
- <code class="ruby"> } }</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="8">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:arrayField) { vcr('arrayField') {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="9">
-
-
- <code class="ruby"> Contentful::Client.new(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="10">
-
-
- <code class="ruby"> space: 'wl1z0pal05vy',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="11">
-
-
- <code class="ruby"> access_token: '9b76e1bbc29eb513611a66b9fc5fb7acd8d95e83b0f7d6bacfe7ec926c819806'</code>
- </li>
-
- <li class="covered" data-hits="26" data-linenumber="12">
- <span class="hits">26</span>
-
- <code class="ruby"> ).content_type('2PqfXUJwE8qSYKuM0U6w8M').fields.select { |f| f.id == 'categories' }.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="13">
-
-
- <code class="ruby"> } }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(field.id).to eq 'name'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #name' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(field.name).to eq 'Name'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(field.type).to eq 'Text'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'could have #items' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(field).to respond_to :items</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"> it 'has #required' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(field.required).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #localized' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(field.required).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Link field properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(linkField.type).to eq 'Link'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="45">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #linkType' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(linkField.link_type).to eq 'Asset'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="51">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Array field properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(arrayField.type).to eq 'Array'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="54">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="55">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #items' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(arrayField.items.type).to eq 'Link'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="58">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(arrayField.items.link_type).to eq 'Entry'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="59">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="61">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="62">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'issues' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="63">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'json field' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="64">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can coerce properly when top level is not object' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="65">
- <span class="hits">1</span>
-
- <code class="ruby"> coercion = Contentful::ObjectCoercion.new([{foo: 123}])</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="66">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(coercion.coerce).to eq [{foo: 123}]</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="67">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="68">
- <span class="hits">1</span>
-
- <code class="ruby"> coercion = Contentful::ObjectCoercion.new('foobar')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="69">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(coercion.coerce).to eq 'foobar'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="70">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="71">
- <span class="hits">1</span>
-
- <code class="ruby"> coercion = Contentful::ObjectCoercion.new(true)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="72">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(coercion.coerce).to eq true</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="73">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="74">
- <span class="hits">1</span>
-
- <code class="ruby"> coercion = Contentful::ObjectCoercion.new(123)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="75">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(coercion.coerce).to eq 123</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="76">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="77">
- <span class="hits">1</span>
-
- <code class="ruby"> coercion = Contentful::ObjectCoercion.new({foo: 123})</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="78">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(coercion.coerce).to eq(foo: 123)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="79">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="80">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="81">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="82">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'datetime field' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="83">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can coerce properly when value is nil' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="84">
- <span class="hits">1</span>
-
- <code class="ruby"> coercion = Contentful::DateCoercion.new(nil)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="85">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(coercion.coerce).to eq(nil)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="86">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="87">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="88">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can coerce properly when value is already datetime' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="89">
- <span class="hits">1</span>
-
- <code class="ruby"> value = DateTime.new</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="90">
- <span class="hits">1</span>
-
- <code class="ruby"> coercion = Contentful::DateCoercion.new(value)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="91">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(coercion.coerce).to eq value</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="92">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="93">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="94">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="95">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="f319b7711f92cae0e531bde60aaa88fa553e06cf">
- <div class="header">
- <h3>spec/file_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>18</b> relevant lines.
- <span class="green"><b>18</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 'spec_helper'</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 Contentful::File do</code>
- </li>
-
- <li class="covered" data-hits="9" data-linenumber="4">
- <span class="hits">9</span>
-
- <code class="ruby"> let(:file) { vcr('asset') { create_client.asset('nyancat').file } }</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"> describe 'Properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #file_name' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(file.file_name).to eq 'Nyan_cat_250px_frame.png'</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 'has #content_type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(file.content_type).to eq 'image/png'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="13">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(file.url).to eq '//images.contentful.com/cfexampleapi/4gp6taAwW4CmSgumq2ekUm/9da0cd1936871b8d72343e895a00d611/Nyan_cat_250px_frame.png'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #details' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(file.details).to be_instance_of Hash</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="21">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'supports camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('asset') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> file = create_client(use_camel_case: true).asset('nyancat').file</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(file.contentType).to eq 'image/png'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(file.fileName).to eq 'Nyan_cat_250px_frame.png'</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"> end</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="0e177320f9d9f1f1848788e038064e0e57e552dd">
- <div class="header">
- <h3>spec/link_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>28</b> relevant lines.
- <span class="green"><b>28</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 'spec_helper'</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 Contentful::Link do</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="4">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:client) { create_client }</code>
- </li>
-
- <li class="covered" data-hits="13" data-linenumber="5">
- <span class="hits">13</span>
-
- <code class="ruby"> let(:entry) { vcr('entry') { create_client.entry('nyancat') } }</code>
- </li>
-
- <li class="covered" data-hits="6" data-linenumber="6">
- <span class="hits">6</span>
-
- <code class="ruby"> let(:link) { entry.space }</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="7">
- <span class="hits">2</span>
-
- <code class="ruby"> let(:content_type_link) { entry.content_type }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="8">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="10">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="11">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(link.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(link.sys.keys.sample).to be_a Symbol</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="13">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(link.id).to eq 'cfexampleapi'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(link.type).to eq 'Link'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="21">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #link_type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(link.link_type).to eq 'Space'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="25">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#resolve' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'queries the api for the resource' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="30">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('space')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(link.resolve(client)).to be_a Contentful::Space</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>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="35">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'queries the api for the resource (different link object)' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('content_type')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(content_type_link.resolve(client)).to be_a Contentful::ContentType</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="40">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="41">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'supports camel case' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="44">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('entry') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="45">
- <span class="hits">1</span>
-
- <code class="ruby"> space_link = create_client(use_camel_case: true).entry('nyancat').space</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space_link.linkType).to eq 'Space'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="47">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="3087380aad15023264d655b41cb4b039f41d8e4d">
- <div class="header">
- <h3>spec/locale_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>18</b> relevant lines.
- <span class="green"><b>18</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 'spec_helper'</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 Contentful::Locale do</code>
- </li>
-
- <li class="covered" data-hits="7" data-linenumber="4">
- <span class="hits">7</span>
-
- <code class="ruby"> let(:locale) { vcr('locale') { create_client.space.locales.first } }</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"> describe 'Properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #code' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(locale.code).to eq 'en-US'</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 'has #name' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(locale.name).to eq 'English'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="13">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #default' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(locale.default).to eq true</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'locales endpoint' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'locales can be fetched from environments' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('locale_from_environment') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"> space: 'facgnwwgj5fe',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="25">
-
-
- <code class="ruby"> access_token: '<ACCESS_TOKEN>',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> environment: 'testing'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"> )</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="28">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> locales = client.locales</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="30">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(locales).to be_a ::Contentful::Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="32">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(locales.first).to be_a ::Contentful::Locale</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(locales.first.code).to eq 'en-US'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"> end</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">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="05f5b25581a35a18308ada667027abe9591adca2">
- <div class="header">
- <h3>spec/location_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>12</b> relevant lines.
- <span class="green"><b>12</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 'spec_helper'</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 Contentful::Location do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> let(:location)do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="5">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('location')do</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="6">
-
-
- <code class="ruby"> Contentful::Client.new(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="7">
-
-
- <code class="ruby"> space: 'lzjz8hygvfgu',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="8">
-
-
- <code class="ruby"> access_token: '0c6ef483524b5e46b3bafda1bf355f38f5f40b4830f7599f790a410860c7c271',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="9">
-
-
- <code class="ruby"> dynamic_entries: :auto,</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="10">
- <span class="hits">2</span>
-
- <code class="ruby"> ).entry('3f6fq5ylFCi4kIYAQKsAYG').location</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"> describe 'Properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #lat' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(location.lat).to be_a Float</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(location.lat.to_i).to eq 36</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #lon' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(location.lon).to be_a Float</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(location.lon.to_i).to eq(-94)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="25">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="95ae9505ac5703f29dc61019198d16ca813935a2">
- <div class="header">
- <h3>spec/request_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>31</b> relevant lines.
- <span class="green"><b>31</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 'spec_helper'</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 Contentful::Request do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#get' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="5">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'calls client' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="6">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> request = Contentful::Request.new(client, '/content_types', nil, 'nyancat')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="8">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(client).to receive(:get).with(request)</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"> request.get</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'converts arrays given in query to comma strings' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> client = create_client</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="18">
- <span class="hits">1</span>
-
- <code class="ruby"> request = Contentful::Request.new(client, '/entries', 'fields.likes[in]' => %w(jake finn))</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request.query[:'fields.likes[in]']).to eq 'jake,finn'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="20">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="21">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> context '[single resource]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> let(:request)do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="25">
- <span class="hits">2</span>
-
- <code class="ruby"> Contentful::Request.new(create_client, '/content_types', nil, 'nyancat')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="27">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'contais endpoint' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="30">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request.url).to include 'content_types'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="31">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="32">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'contains id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="34">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request.url).to include 'nyancat'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"> end</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="39">
- <span class="hits">1</span>
-
- <code class="ruby"> context '[multi resource]' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="40">
- <span class="hits">1</span>
-
- <code class="ruby"> let(:request)do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="41">
- <span class="hits">2</span>
-
- <code class="ruby"> Contentful::Request.new(create_client, '/content_types', 'something' => 'requested')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="42">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="43">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="44">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="45">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'contains query' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request.query).not_to be_empty</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request.query[:something]).to eq 'requested'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="51">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'contais endpoint' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(request.url).to include 'content_types'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="54">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="55">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="56">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="57">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="9c14f2e925ace67d177e53f0129d77745bd3f83f">
- <div class="header">
- <h3>spec/resource_building_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>21</b> relevant lines.
- <span class="green"><b>21</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 'spec_helper'</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 'Resource Building Examples' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can deal with arrays' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="5">
- <span class="hits">1</span>
-
- <code class="ruby"> request = Contentful::Request.new(nil, 'entries')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="6">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new(raw_fixture('link_array'), request)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> resource = Contentful::ResourceBuilder.new(response.object).run</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="8">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(resource.fields[:links]).to be_a Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="10">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(resource.fields[:links].first).to be_a Contentful::Link</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'replaces links with included versions if present' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="14">
- <span class="hits">1</span>
-
- <code class="ruby"> request = Contentful::Request.new(nil, 'entries')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new(raw_fixture('includes'), request)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> resource = Contentful::ResourceBuilder.new(response.object).run.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="18">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(resource.fields[:links]).to be_a Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(resource.fields[:links].first).to be_a Contentful::Entry</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="20">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="21">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'can also reference itself' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> request = Contentful::Request.new(nil, 'entries')</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> response = Contentful::Response.new(raw_fixture('self_link'), request)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> resource = Contentful::ResourceBuilder.new(response.object).run.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="26">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> other_resource = resource.fields[:e]</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(other_resource).to be_a Contentful::Entry</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="29">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(other_resource.fields[:e]).to eq resource</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">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="19ee8dac79d02390e73ed93191aa8c676874060e">
- <div class="header">
- <h3>spec/response_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>35</b> relevant lines.
- <span class="green"><b>35</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 'spec_helper'</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 Contentful::Response do</code>
- </li>
-
- <li class="covered" data-hits="5" data-linenumber="4">
- <span class="hits">5</span>
-
- <code class="ruby"> let(:successful_response) { Contentful::Response.new raw_fixture('nyancat'), Contentful::Request.new(nil, '/entries', nil, 'nyancat') }</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="5">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:error_response) { Contentful::Response.new raw_fixture('not_found', 404) }</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="6">
- <span class="hits">3</span>
-
- <code class="ruby"> let(:unparsable_response) { Contentful::Response.new raw_fixture('unparsable') }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="7">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#raw' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns the raw response it has been initalized with' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="10">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(successful_response.raw.to_s).to eql raw_fixture('nyancat').to_s</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"> describe '#object' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
-
- <code class="ruby"> it "returns the repsonse's parsed json" do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(successful_response.object).to eq json_fixture('nyancat')</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="19">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#request' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns the request the response has been initalized with' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(successful_response.request).to be_a Contentful::Request</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="25">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#status' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns :ok for normal responses' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(successful_response.status).to eq :ok</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="29">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="30">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns :error for error responses' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="32">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error_response.status).to eq :error</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="33">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="35">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns :error for unparsable json responses' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(unparsable_response.status).to eq :error</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="37">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="39">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns :error for responses without content' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="40">
- <span class="hits">1</span>
-
- <code class="ruby"> raw_response = ''</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="41">
- <span class="hits">3</span>
-
- <code class="ruby"> allow(raw_response).to receive(:status) { 204 }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> no_content_response = Contentful::Response.new raw_response</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="43">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(no_content_response.status).to eq :no_content</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"> end</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="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#error_message' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="48">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns contentful error message for contentful errors' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="49">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error_response.error_message).to eq 'The resource could not be found.'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="51">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="52">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns json parser error message for json parse errors' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="53">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(unparsable_response.error_message).to include 'unexpected token'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="54">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="55">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns a ServiceUnavailable error on a 503' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> error_response = Contentful::Response.new raw_fixture('not_found', 503)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="58">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error_response.status).to eql :error</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="59">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(error_response.object).to be_kind_of Contentful::ServiceUnavailable</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="61">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="62">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="af3edbfb21ba19158fe1a8aee1384a7e9b406807">
- <div class="header">
- <h3>spec/space_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>17</b> relevant lines.
- <span class="green"><b>17</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 'spec_helper'</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 Contentful::Space do</code>
- </li>
-
- <li class="covered" data-hits="11" data-linenumber="4">
- <span class="hits">11</span>
-
- <code class="ruby"> let(:space) { vcr('space') { create_client.space } }</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"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space.sys.keys.sample).to be_a Symbol</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="10">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="11">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="12">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #id' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space.id).to eq 'cfexampleapi'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="14">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="16">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="17">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space.type).to eq 'Space'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</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"> describe 'Properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #name' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space.name).to eq 'Contentful Example API'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="25">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #locales' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space.locales).to be_a Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="28">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(space.locales.first).to be_a Contentful::Locale</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="29">
-
-
- <code class="ruby"> end</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">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
<div class="source_table" id="5eb25a1b26ae65158e1a7386a20084d608b4951d">
<div class="header">
<h3>spec/support/client.rb</h3>
<h4><span class="green">100.0 %</span> covered</h4>
<div>
@@ -27052,12 +13785,12 @@
<span class="hits">1</span>
<code class="ruby">def create_client(options = {})</code>
</li>
- <li class="covered" data-hits="212" data-linenumber="2">
- <span class="hits">212</span>
+ <li class="covered" data-hits="47" data-linenumber="2">
+ <span class="hits">47</span>
<code class="ruby"> Contentful::Client.new({</code>
</li>
<li class="never" data-hits="" data-linenumber="3">
@@ -27090,15 +13823,15 @@
<div class="source_table" id="a4ba320676b73b8644cffc9dbb12bbe8e19a9934">
<div class="header">
<h3>spec/support/json_responses.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="red">27.27 %</span> covered</h4>
<div>
<b>11</b> relevant lines.
- <span class="green"><b>11</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>3</b> lines covered</span> and
+ <span class="red"><b>8</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -27119,55 +13852,55 @@
<span class="hits">1</span>
<code class="ruby">def raw_fixture(which, status = 200, _as_json = false, headers = {})</code>
</li>
- <li class="covered" data-hits="40" data-linenumber="4">
- <span class="hits">40</span>
+ <li class="missed" data-hits="0" data-linenumber="4">
+
<code class="ruby"> object = Object.new</code>
</li>
- <li class="covered" data-hits="225" data-linenumber="5">
- <span class="hits">225</span>
+ <li class="missed" data-hits="0" data-linenumber="5">
+
<code class="ruby"> allow(object).to receive(:status) { status }</code>
</li>
- <li class="covered" data-hits="125" data-linenumber="6">
- <span class="hits">125</span>
+ <li class="missed" data-hits="0" data-linenumber="6">
+
<code class="ruby"> allow(object).to receive(:headers) { headers }</code>
</li>
- <li class="covered" data-hits="163" data-linenumber="7">
- <span class="hits">163</span>
+ <li class="missed" data-hits="0" data-linenumber="7">
+
<code class="ruby"> allow(object).to receive(:to_s) { File.read File.dirname(__FILE__) + "/../fixtures/json_responses/#{which}.json" }</code>
</li>
- <li class="covered" data-hits="53" data-linenumber="8">
- <span class="hits">53</span>
+ <li class="missed" data-hits="0" data-linenumber="8">
+
<code class="ruby"> allow(object).to receive(:body) { object.to_s }</code>
</li>
- <li class="covered" data-hits="44" data-linenumber="9">
- <span class="hits">44</span>
+ <li class="missed" data-hits="0" data-linenumber="9">
+
<code class="ruby"> allow(object).to receive(:[]) { |key| object.headers[key] }</code>
</li>
<li class="never" data-hits="" data-linenumber="10">
<code class="ruby"></code>
</li>
- <li class="covered" data-hits="40" data-linenumber="11">
- <span class="hits">40</span>
+ <li class="missed" data-hits="0" data-linenumber="11">
+
<code class="ruby"> object</code>
</li>
<li class="never" data-hits="" data-linenumber="12">
@@ -27185,13 +13918,13 @@
<span class="hits">1</span>
<code class="ruby">def json_fixture(which, _as_json = false)</code>
</li>
- <li class="covered" data-hits="1" data-linenumber="15">
- <span class="hits">1</span>
+ <li class="missed" data-hits="0" data-linenumber="15">
+
<code class="ruby"> MultiJson.load(</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
@@ -27217,15 +13950,15 @@
<div class="source_table" id="027342a1ab3607ccd90fe9e5972948d26cbc8bed">
<div class="header">
<h3>spec/support/vcr.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
+ <h4><span class="yellow">90.0 %</span> covered</h4>
<div>
<b>10</b> relevant lines.
- <span class="green"><b>10</b> lines covered</span> and
- <span class="red"><b>0</b> lines missed.</span>
+ <span class="green"><b>9</b> lines covered</span> and
+ <span class="red"><b>1</b> lines missed.</span>
</div>
</div>
<pre>
<ol>
@@ -27288,12 +14021,12 @@
<span class="hits">1</span>
<code class="ruby">def vcr(name, &block)</code>
</li>
- <li class="covered" data-hits="191" data-linenumber="11">
- <span class="hits">191</span>
+ <li class="covered" data-hits="48" data-linenumber="11">
+ <span class="hits">48</span>
<code class="ruby"> VCR.use_cassette(name, &block)</code>
</li>
<li class="never" data-hits="" data-linenumber="12">
@@ -27312,1752 +14045,16 @@
<span class="hits">1</span>
<code class="ruby">def expect_vcr(name, &block)</code>
</li>
- <li class="covered" data-hits="14" data-linenumber="15">
- <span class="hits">14</span>
+ <li class="missed" data-hits="0" data-linenumber="15">
+
<code class="ruby"> expect { VCR.use_cassette(name, &block) }</code>
</li>
<li class="never" data-hits="" data-linenumber="16">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="95b8bb4afe6ed95b076be799979ae2c639fbab8f">
- <div class="header">
- <h3>spec/sync_page_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>54</b> relevant lines.
- <span class="green"><b>54</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 'spec_helper'</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 Contentful::SyncPage do</code>
- </li>
-
- <li class="covered" data-hits="15" data-linenumber="4">
- <span class="hits">15</span>
-
- <code class="ruby"> let(:page_with_more) { vcr('sync_page') { create_client.sync(initial: true).first_page } }</code>
- </li>
-
- <li class="covered" data-hits="23" data-linenumber="5">
- <span class="hits">23</span>
-
- <code class="ruby"> let(:page) { vcr('sync_page_2') { create_client.sync.get('https://cdn.contentful.com/spaces/cfexampleapi/environments/master/sync?sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCr8Okw6AYwqbDksO3ehvDpUPCgcKsKXbCiAwPC8K2w4LDvsOkw6nCjhPDpcOQADElWsOoU8KGR3HCtsOAwqd6wp_Dulp8w6LDsF_CtsK7Kk05wrMvwrLClMOgG2_Dn2sGPg') } }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="6">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="7">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'SystemProperties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has a #sys getter returning a hash with symbol keys' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="9">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.sys).to be_a Hash</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="10">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.sys.keys.sample).to be_a Symbol</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="13">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #type' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="14">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.type).to eq 'Array'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="15">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="16">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="17">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="18">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Properties' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="19">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'has #items which contain resources' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="20">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page_with_more.items).to be_a Array</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="21">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page_with_more.items.sample).to be_a Contentful::BaseResource</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="22">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="23">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="24">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Fields' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'properly deals with nested locale fields' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page_with_more.items.first.fields[:name]).to eq 'London'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="28">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="29">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="30">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="31">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#each' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="32">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'is an Enumerator' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="33">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.each).to be_a Enumerator</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="34">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="35">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="36">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'iterates over items' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="37">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.each.to_a).to eq page.items</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="40">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'includes Enumerable' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.map { |r| r.type }).to eq page.items.map { |r| r.type }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="42">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="43">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="45">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#next_sync_url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="46">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return the next_sync_url if there is one' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.next_sync_url).to be_a String</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="48">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="49">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="50">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return nil if note last page, yet' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="51">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page_with_more.next_sync_url).to be_nil</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="52">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="53">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="54">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="55">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#next_page_url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return the next_page_url if there is one' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page_with_more.next_page_url).to be_a String</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"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="60">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return nil if on last page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="61">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.next_page_url).to be_nil</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="62">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="63">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="64">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="65">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#next_page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="66">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'requests the next page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="67">
- <span class="hits">1</span>
-
- <code class="ruby"> next_page = vcr('sync_page_2')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="68">
- <span class="hits">1</span>
-
- <code class="ruby"> page_with_more.next_page</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="69">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="70">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(next_page).to be_a Contentful::SyncPage</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="71">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="72">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="73">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return nil if last page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="74">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.next_page_url).to be_nil</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="75">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="76">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="77">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="78">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#next_page?' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="79">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return true if there is a next page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="80">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page_with_more.next_page?).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="81">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="82">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="83">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return false if last page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="84">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.next_page?).to be_falsey</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="85">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="86">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="87">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="88">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#last_page?' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="89">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return true if no more pages available' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="90">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.last_page?).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="91">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="92">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="93">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return false if more pages available' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="94">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page_with_more.last_page?).to be_falsey</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="95">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="96">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="97">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="98">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#sync' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="99">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns the sync that created the page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="100">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.sync).to be_a Contentful::Sync</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="101">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="102">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="103">
-
-
- <code class="ruby">end</code>
- </li>
-
- </ol>
- </pre>
-</div>
-
-
- <div class="source_table" id="f811ceb52b7a29eaa4e3dd16037352e742150ad6">
- <div class="header">
- <h3>spec/sync_spec.rb</h3>
- <h4><span class="green">100.0 %</span> covered</h4>
- <div>
- <b>79</b> relevant lines.
- <span class="green"><b>79</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 'spec_helper'</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 Contentful::Sync do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="4">
- <span class="hits">1</span>
-
- <code class="ruby"> before :each do</code>
- </li>
-
- <li class="covered" data-hits="14" data-linenumber="5">
- <span class="hits">14</span>
-
- <code class="ruby"> Contentful::ContentTypeCache.clear!</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="6">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="7">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="8">
- <span class="hits">1</span>
-
- <code class="ruby"> let(:first_page) do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="9">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('sync_page')do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="10">
- <span class="hits">2</span>
-
- <code class="ruby"> create_client.sync(initial: true).first_page</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"> let(:last_page) do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="15">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('sync_page')do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="16">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('sync_page_2')do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="17">
- <span class="hits">2</span>
-
- <code class="ruby"> create_client.sync(initial: true).first_page.next_page</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="18">
-
-
- <code class="ruby"> end</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"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="21">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="22">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'environments' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="23">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'works for environments' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="24">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_environment') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="25">
- <span class="hits">1</span>
-
- <code class="ruby"> page = nil</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="26">
- <span class="hits">1</span>
-
- <code class="ruby"> expect {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="27">
- <span class="hits">1</span>
-
- <code class="ruby"> page = create_client(</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="28">
-
-
- <code class="ruby"> space: 'a22o2qgm356c',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="29">
-
-
- <code class="ruby"> access_token: 'bfbc63cf745a037125dbcc64f716a9a0e9d091df1a79e84920b890f87a6e7ab9',</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="30">
-
-
- <code class="ruby"> environment: 'staging'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="31">
-
-
- <code class="ruby"> ).sync(initial: true).first_page</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="32">
-
-
- <code class="ruby"> }.not_to raise_exception</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"> expect(page.items.first).to be_a ::Contentful::Entry</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="35">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(page.items.first.environment.id).to eq 'staging'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="36">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="37">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="38">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="39">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="40">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#initialize' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="41">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'takes an options hash on initialization' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="42">
- <span class="hits">1</span>
-
- <code class="ruby"> expect do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="43">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('sync_deletion') { create_client.sync(initial: true, type: 'Deletion').first_page }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="44">
-
-
- <code class="ruby"> end.not_to raise_exception</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="covered" data-hits="1" data-linenumber="47">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'takes a next_sync_url on initialization' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="48">
- <span class="hits">1</span>
-
- <code class="ruby"> expect do</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="49">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('sync_page_2') { create_client.sync('https://cdn.contentful.com/spaces/cfexampleapi/environments/master/sync?sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCr8Okw6AYwqbDksO3ehvDpUPCgcKsKXbCiAwPC8K2w4LDvsOkw6nCjhPDpcOQADElWsOoU8KGR3HCtsOAwqd6wp_Dulp8w6LDsF_CtsK7Kk05wrMvwrLClMOgG2_Dn2sGPg').first_page }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="50">
-
-
- <code class="ruby"> end.not_to raise_exception</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="51">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="52">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="53">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="54">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#first_page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="55">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns only the first page of a new sync' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="56">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_page')do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="57">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(create_client.sync(initial: true).first_page).to be_a Contentful::SyncPage</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>
-
- <li class="never" data-hits="" data-linenumber="60">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="61">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="62">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#each_page' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="63">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'iterates through sync pages' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="64">
- <span class="hits">1</span>
-
- <code class="ruby"> sync = create_client.sync(initial: true)</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="65">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('sync_page'){ vcr('sync_page_2'){</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="66">
- <span class="hits">1</span>
-
- <code class="ruby"> count = 0</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="67">
- <span class="hits">1</span>
-
- <code class="ruby"> sync.each_page do |page|</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="68">
- <span class="hits">2</span>
-
- <code class="ruby"> expect(page).to be_a Contentful::SyncPage</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="69">
- <span class="hits">2</span>
-
- <code class="ruby"> count += 1</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="70">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="71">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(count).to eq 2</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="72">
-
-
- <code class="ruby"> }}</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="73">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="74">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="75">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="76">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#next_sync_url' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="77">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'is empty if there are still more pages to request in the current sync' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="78">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(first_page.next_sync_url).to be_nil</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="79">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="80">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="81">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'returns the url to continue the sync next time' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="82">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(last_page.next_sync_url).to be_a String</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="83">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="84">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="85">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="86">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#completed?' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="87">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return true if no more pages to request in the current sync' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="88">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(first_page.next_sync_url).to be_falsey</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="89">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="90">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="91">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will return true if not all pages requested, yet' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="92">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(last_page.next_sync_url).to be_truthy</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="93">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="94">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="95">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="96">
- <span class="hits">1</span>
-
- <code class="ruby"> describe '#each_item' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="97">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will directly iterate through all resources' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="98">
- <span class="hits">1</span>
-
- <code class="ruby"> sync = create_client.sync(initial: true)</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="99">
- <span class="hits">2</span>
-
- <code class="ruby"> vcr('sync_page'){ vcr('sync_page_2'){</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="100">
- <span class="hits">1</span>
-
- <code class="ruby"> sync.each_item do |item|</code>
- </li>
-
- <li class="covered" data-hits="14" data-linenumber="101">
- <span class="hits">14</span>
-
- <code class="ruby"> expect(item).to be_a Contentful::BaseResource</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="102">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="103">
-
-
- <code class="ruby"> }}</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="104">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="105">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="106">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="107">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'Resource parsing' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="108">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'will correctly parse the `file` field of an asset' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="109">
- <span class="hits">1</span>
-
- <code class="ruby"> sync = create_client.sync(initial: true)</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="110">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_page') {</code>
- </li>
-
- <li class="covered" data-hits="15" data-linenumber="111">
- <span class="hits">15</span>
-
- <code class="ruby"> asset = sync.first_page.items.select { |item| item.is_a?(Contentful::Asset) }.first</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="112">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="113">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.file_name).to eq 'doge.jpg'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="114">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.content_type).to eq 'image/jpeg'</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="115">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.details['image']['width']).to eq 5800</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="116">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.details['image']['height']).to eq 4350</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="117">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.details['size']).to eq 522943</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="118">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(asset.file.url).to eq '//images.contentful.com/cfexampleapi/1x0xpXu4pSGS4OukSyWGUK/cc1239c6385428ef26f4180190532818/doge.jpg'</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="119">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="120">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="121">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="122">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="123">
- <span class="hits">1</span>
-
- <code class="ruby"> describe 'raw_mode' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="124">
- <span class="hits">1</span>
-
- <code class="ruby"> before do</code>
- </li>
-
- <li class="covered" data-hits="3" data-linenumber="125">
- <span class="hits">3</span>
-
- <code class="ruby"> @sync = create_client(raw_mode: true).sync(initial: true)</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="126">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="127">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="128">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'should not fail' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="129">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_page_short') {</code>
- </li>
-
- <li class="covered" data-hits="2" data-linenumber="130">
- <span class="hits">2</span>
-
- <code class="ruby"> expect { @sync.first_page }.not_to raise_error</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="131">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="132">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="133">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="134">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'should return a raw Response' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="135">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_page_short') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="136">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(@sync.first_page).to be_a Contentful::Response</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="137">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="138">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="139">
-
-
- <code class="ruby"></code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="140">
- <span class="hits">1</span>
-
- <code class="ruby"> it 'should return JSON' do</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="141">
- <span class="hits">1</span>
-
- <code class="ruby"> expected = {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="142">
-
-
- <code class="ruby"> "sys" => {"type" => "Array"},</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="143">
-
-
- <code class="ruby"> "items" => [</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="144">
-
-
- <code class="ruby"> {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="145">
-
-
- <code class="ruby"> "sys" => {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="146">
-
-
- <code class="ruby"> "space" => {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="147">
-
-
- <code class="ruby"> "sys" => {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="148">
-
-
- <code class="ruby"> "type" => "Link",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="149">
-
-
- <code class="ruby"> "linkType" => "Space",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="150">
-
-
- <code class="ruby"> "id" => "cfexampleapi"}</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="151">
-
-
- <code class="ruby"> },</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="152">
-
-
- <code class="ruby"> "type" => "Entry",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="153">
-
-
- <code class="ruby"> "contentType" => {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="154">
-
-
- <code class="ruby"> "sys" => {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="155">
-
-
- <code class="ruby"> "type" => "Link",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="156">
-
-
- <code class="ruby"> "linkType" => "ContentType",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="157">
-
-
- <code class="ruby"> "id" => "1t9IbcfdCk6m04uISSsaIK"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="158">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="159">
-
-
- <code class="ruby"> },</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="160">
-
-
- <code class="ruby"> "id" => "5ETMRzkl9KM4omyMwKAOki",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="161">
-
-
- <code class="ruby"> "revision" => 2,</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="162">
-
-
- <code class="ruby"> "createdAt" => "2014-02-21T13:42:57.752Z",</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="163">
-
-
- <code class="ruby"> "updatedAt" => "2014-04-16T12:44:02.691Z"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="164">
-
-
- <code class="ruby"> },</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="165">
-
-
- <code class="ruby"> "fields" => {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="166">
-
-
- <code class="ruby"> "name" => {"en-US"=>"London"},</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="167">
-
-
- <code class="ruby"> "center" => {</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="168">
-
-
- <code class="ruby"> "en-US" => {"lat"=>51.508515, "lon"=>-0.12548719999995228}</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="169">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="170">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="171">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="172">
-
-
- <code class="ruby"> ],</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="173">
-
-
- <code class="ruby"> "nextSyncUrl" => "https://cdn.contentful.com/spaces/cfexampleapi/environments/master/sync?sync_token=w5ZGw6JFwqZmVcKsE8Kow4grw45QdybCr8Okw6AYwqbDksO3ehvDpUPCgcKsKXbCiAwPC8K2w4LDvsOkw6nCjhPDpcOQADElWsOoU8KGR3HCtsOAwqd6wp_Dulp8w6LDsF_CtsK7Kk05wrMvwrLClMOgG2_Dn2sGPg"</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="174">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="175">
- <span class="hits">1</span>
-
- <code class="ruby"> vcr('sync_page_short') {</code>
- </li>
-
- <li class="covered" data-hits="1" data-linenumber="176">
- <span class="hits">1</span>
-
- <code class="ruby"> expect(@sync.first_page.object).to eql expected</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="177">
-
-
- <code class="ruby"> }</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="178">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="179">
-
-
- <code class="ruby"> end</code>
- </li>
-
- <li class="never" data-hits="" data-linenumber="180">
<code class="ruby">end</code>
</li>