rails_sitemap 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de8570291488a9c71c47e368821d87cd1854f188
4
- data.tar.gz: f680580621d783e287ecfe2067ff0f2fa15e26ff
3
+ metadata.gz: ce924d7fa6e619f5570ed629e27e5d46ff1e5793
4
+ data.tar.gz: 9909d3e927aa6478318e367e4eada3c2c2e00920
5
5
  SHA512:
6
- metadata.gz: e7ca5fbb02ccd749e2a30ae661829f40c06329211230b98899013348c420259833d4bb217dfe8c9543fb0b8104bdbf69c5c6e99b5ea227cbc34e2d44e58f50cc
7
- data.tar.gz: 468952e555c373312d00ceaa610ad9cacc276058ab2d84e032bbfd19c8981cc333e63d43a4dc789d2a25654b25f96e10723e99796580b15a32b5ed1f08254b5a
6
+ metadata.gz: 405b06ecf03b291ff42941376ad53b770f8257ebc242ef5d282e7e759a91ffe87ed34f8d1e986addb8f08604723f48067543c1d07d4254e9f55deb2c2c8cfad8
7
+ data.tar.gz: a50aa5c5e7baf91e2627c1bc84aad5dd5c28062fcf28014a1f861b654eb1568f8a03593bb4cd7ce19581f067b509b811baa20792e60463e81c81af3dc89d31c6
@@ -36,8 +36,8 @@ module RailsSitemap
36
36
  EXCLUDED_PATHS.include?(route[:path])
37
37
  end
38
38
 
39
- @routes = @routes.map do|route|
40
- route[:path][0..-11]
39
+ @sitemap_entries = @routes.map do|route|
40
+ SitemapEntry.new(route[:path][0..-11])
41
41
  end
42
42
  end
43
43
 
@@ -54,11 +54,17 @@ module RailsSitemap
54
54
 
55
55
  model_class.all.each do |object|
56
56
  id = object.try(:slug) || object.id
57
- @routes << "/#{model_sitemap.pluralize.downcase}/#{id}"
57
+
58
+ object_path = "/#{model_sitemap.pluralize.downcase}/#{id}"
59
+ last_modification = object.updated_at.to_datetime.to_s
60
+ object_priority = RailsSitemap.priority
61
+
62
+ @sitemap_entries <<
63
+ SitemapEntry.new(object_path, object_priority, last_modification)
58
64
  end
59
65
  end
60
66
 
61
- @routes.uniq
67
+ @sitemap_entries.uniq
62
68
  end
63
69
  end
64
70
  end
@@ -0,0 +1,13 @@
1
+ module RailsSitemap
2
+ class SitemapEntry
3
+ attr :path, :priority, :updated_at
4
+
5
+ def initialize(path,
6
+ priority = RailsSitemap.priority,
7
+ updated_at = RailsSitemap.updated_at)
8
+ @path = path
9
+ @priority = priority
10
+ @updated_at = updated_at
11
+ end
12
+ end
13
+ end
@@ -2,17 +2,17 @@
2
2
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:geo="http://www.google.com/geo/schemas/sitemap/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:pagemap="http://www.google.com/schemas/sitemap-pagemap/1.0" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
3
3
  <url>
4
4
  <loc><%= @current_domain %></loc>
5
- <lastmod>2016-09-22T18:11:05-03:00</lastmod>
6
- <changefreq>always</changefreq>
5
+ <lastmod><%= RailsSitemap.updated_at %></lastmod>
6
+ <changefreq><%= RailsSitemap.update_frequency_for_app %></changefreq>
7
7
  <priority>1.0</priority>
8
8
  </url>
9
9
 
10
- <% @routes.each do |route| %>
10
+ <% @sitemap_entries.each do |sitemap_entry| %>
11
11
  <url>
12
- <loc><%= @current_domain + route %></loc>
13
- <lastmod>2016-09-22T18:11:05-03:00</lastmod>
14
- <changefreq>weekly</changefreq>
15
- <priority>0.5</priority>
12
+ <loc><%= @current_domain + sitemap_entry.path %></loc>
13
+ <lastmod><%= sitemap_entry.updated_at%></lastmod>
14
+ <changefreq><%=RailsSitemap.update_frequency_for_models%></changefreq>
15
+ <priority><%= sitemap_entry.priority%></priority>
16
16
  </url>
17
17
  <% end %>
18
18
  </urlset>
@@ -10,8 +10,17 @@ module RailsSitemap
10
10
  end
11
11
 
12
12
  class << self
13
- mattr_accessor :models_for_sitemap
13
+ mattr_accessor :models_for_sitemap,
14
+ :updated_at,
15
+ :priority,
16
+ :update_frequency_for_app,
17
+ :update_frequency_for_models
18
+
14
19
  self.models_for_sitemap = []
20
+ self.updated_at = DateTime.now.to_s
21
+ self.priority = 0.5
22
+ self.update_frequency_for_app = 'always'
23
+ self.update_frequency_for_models = 'weekly'
15
24
  end
16
25
 
17
26
  def self.setup(&block)
@@ -1,3 +1,3 @@
1
1
  module RailsSitemap
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -1,3 +1,7 @@
1
1
  RailsSitemap.setup do |config|
2
2
  config.models_for_sitemap = %w(Article)
3
+ config.updated_at = '2016-09-22T18:11:05-03:00'
4
+ config.priority = 0.5
5
+ config.update_frequency_for_app = 'always'
6
+ config.update_frequency_for_models = 'weekly'
3
7
  end
@@ -2079,5 +2079,566 @@ Completed 200 OK in 6ms (Views: 4.0ms | ActiveRecord: 0.1ms)
2079
2079
   (0.0ms) begin transaction
2080
2080
  ----------------------------
2081
2081
  RailsSitemapTest: test_truth
2082
+ ----------------------------
2083
+  (0.0ms) rollback transaction
2084
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2085
+  (0.1ms) begin transaction
2086
+ ----------------------------
2087
+ RailsSitemapTest: test_truth
2088
+ ----------------------------
2089
+  (0.0ms) rollback transaction
2090
+  (0.0ms) begin transaction
2091
+ --------------------------------------------------------
2092
+ SitemapControllerTest: test_should_return_a_success_code
2093
+ --------------------------------------------------------
2094
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:40:30 -0300
2095
+ Processing by RailsSitemap::SitemapController#index as XML
2096
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2097
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2098
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (11.5ms)
2099
+ Completed 500 Internal Server Error in 23ms (ActiveRecord: 0.2ms)
2100
+  (0.1ms) rollback transaction
2101
+  (0.1ms) begin transaction
2102
+ -----------------------------------------------------------------
2103
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2104
+ -----------------------------------------------------------------
2105
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2106
+  (0.0ms) SAVEPOINT active_record_1
2107
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:40:30 UTC], ["updated_at", 2016-09-26 17:40:30 UTC]]
2108
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2109
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:40:30 -0300
2110
+ Processing by RailsSitemap::SitemapController#index as XML
2111
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2112
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2113
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (3.0ms)
2114
+ Completed 500 Internal Server Error in 9ms (ActiveRecord: 0.1ms)
2115
+  (2.3ms) rollback transaction
2116
+  (0.1ms) begin transaction
2117
+ -------------------------------------------------------
2118
+ SitemapControllerTest: test_should_return_the_right_xml
2119
+ -------------------------------------------------------
2120
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:40:30 -0300
2121
+ Processing by RailsSitemap::SitemapController#index as XML
2122
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2123
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2124
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (3.7ms)
2125
+ Completed 500 Internal Server Error in 9ms (ActiveRecord: 0.1ms)
2126
+  (0.1ms) rollback transaction
2127
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2128
+  (0.2ms) begin transaction
2129
+ ----------------------------
2130
+ RailsSitemapTest: test_truth
2131
+ ----------------------------
2132
+  (0.0ms) rollback transaction
2133
+  (0.0ms) begin transaction
2134
+ --------------------------------------------------------
2135
+ SitemapControllerTest: test_should_return_a_success_code
2136
+ --------------------------------------------------------
2137
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:45:18 -0300
2138
+ Processing by RailsSitemap::SitemapController#index as XML
2139
+ Article Load (0.2ms) SELECT "articles".* FROM "articles"
2140
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2141
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (25.2ms)
2142
+ Completed 500 Internal Server Error in 43ms (ActiveRecord: 0.3ms)
2143
+  (0.1ms) rollback transaction
2144
+  (0.0ms) begin transaction
2145
+ -------------------------------------------------------
2146
+ SitemapControllerTest: test_should_return_the_right_xml
2147
+ -------------------------------------------------------
2148
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:45:18 -0300
2149
+ Processing by RailsSitemap::SitemapController#index as XML
2150
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2151
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2152
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (27.7ms)
2153
+ Completed 500 Internal Server Error in 34ms (ActiveRecord: 0.1ms)
2154
+  (0.1ms) rollback transaction
2155
+  (0.1ms) begin transaction
2156
+ -----------------------------------------------------------------
2157
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2158
+ -----------------------------------------------------------------
2159
+ Article Load (0.2ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2160
+  (0.0ms) SAVEPOINT active_record_1
2161
+ SQL (0.3ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:45:18 UTC], ["updated_at", 2016-09-26 17:45:18 UTC]]
2162
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2163
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:45:18 -0300
2164
+ Processing by RailsSitemap::SitemapController#index as XML
2165
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2166
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2167
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (34.3ms)
2168
+ Completed 500 Internal Server Error in 41ms (ActiveRecord: 0.1ms)
2169
+  (2.2ms) rollback transaction
2170
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
2171
+  (0.2ms) begin transaction
2172
+ ----------------------------
2173
+ RailsSitemapTest: test_truth
2174
+ ----------------------------
2175
+  (0.1ms) rollback transaction
2176
+  (0.0ms) begin transaction
2177
+ -----------------------------------------------------------------
2178
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2179
+ -----------------------------------------------------------------
2180
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2181
+  (0.0ms) SAVEPOINT active_record_1
2182
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:45:47 UTC], ["updated_at", 2016-09-26 17:45:47 UTC]]
2183
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2184
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:45:47 -0300
2185
+ Processing by RailsSitemap::SitemapController#index as XML
2186
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2187
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2188
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2189
+ Completed 200 OK in 11ms (Views: 7.0ms | ActiveRecord: 0.1ms)
2190
+  (1.7ms) rollback transaction
2191
+  (0.1ms) begin transaction
2192
+ --------------------------------------------------------
2193
+ SitemapControllerTest: test_should_return_a_success_code
2194
+ --------------------------------------------------------
2195
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:45:47 -0300
2196
+ Processing by RailsSitemap::SitemapController#index as XML
2197
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2198
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2199
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2200
+ Completed 200 OK in 8ms (Views: 5.6ms | ActiveRecord: 0.1ms)
2201
+  (0.1ms) rollback transaction
2202
+  (0.1ms) begin transaction
2203
+ -------------------------------------------------------
2204
+ SitemapControllerTest: test_should_return_the_right_xml
2205
+ -------------------------------------------------------
2206
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:45:47 -0300
2207
+ Processing by RailsSitemap::SitemapController#index as XML
2208
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2209
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2210
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2211
+ Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 0.1ms)
2212
+  (0.1ms) rollback transaction
2213
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2214
+  (0.1ms) begin transaction
2215
+ --------------------------------------------------------
2216
+ SitemapControllerTest: test_should_return_a_success_code
2217
+ --------------------------------------------------------
2218
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:46:56 -0300
2219
+ Processing by RailsSitemap::SitemapController#index as XML
2220
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2221
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2222
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.2ms)
2223
+ Completed 200 OK in 12ms (Views: 7.3ms | ActiveRecord: 0.2ms)
2224
+  (0.1ms) rollback transaction
2225
+  (0.1ms) begin transaction
2226
+ -------------------------------------------------------
2227
+ SitemapControllerTest: test_should_return_the_right_xml
2228
+ -------------------------------------------------------
2229
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:46:56 -0300
2230
+ Processing by RailsSitemap::SitemapController#index as XML
2231
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2232
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2233
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2234
+ Completed 200 OK in 6ms (Views: 4.2ms | ActiveRecord: 0.1ms)
2235
+  (0.1ms) rollback transaction
2236
+  (0.1ms) begin transaction
2237
+ -----------------------------------------------------------------
2238
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2239
+ -----------------------------------------------------------------
2240
+ Article Load (0.2ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2241
+  (0.1ms) SAVEPOINT active_record_1
2242
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:46:56 UTC], ["updated_at", 2016-09-26 17:46:56 UTC]]
2243
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2244
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:46:56 -0300
2245
+ Processing by RailsSitemap::SitemapController#index as XML
2246
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2247
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2248
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.7ms)
2249
+ Completed 200 OK in 8ms (Views: 5.1ms | ActiveRecord: 0.1ms)
2250
+  (1.7ms) rollback transaction
2251
+  (0.1ms) begin transaction
2252
+ ----------------------------
2253
+ RailsSitemapTest: test_truth
2254
+ ----------------------------
2255
+  (0.0ms) rollback transaction
2256
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2257
+  (0.1ms) begin transaction
2258
+ -------------------------------------------------------
2259
+ SitemapControllerTest: test_should_return_the_right_xml
2260
+ -------------------------------------------------------
2261
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:48:20 -0300
2262
+ Processing by RailsSitemap::SitemapController#index as XML
2263
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2264
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2265
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.0ms)
2266
+ Completed 200 OK in 11ms (Views: 6.7ms | ActiveRecord: 0.2ms)
2267
+  (0.1ms) rollback transaction
2268
+  (0.1ms) begin transaction
2269
+ --------------------------------------------------------
2270
+ SitemapControllerTest: test_should_return_a_success_code
2271
+ --------------------------------------------------------
2272
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:48:21 -0300
2273
+ Processing by RailsSitemap::SitemapController#index as XML
2274
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2275
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2276
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2277
+ Completed 200 OK in 11ms (Views: 8.4ms | ActiveRecord: 0.1ms)
2278
+  (0.1ms) rollback transaction
2279
+  (0.1ms) begin transaction
2280
+ -----------------------------------------------------------------
2281
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2282
+ -----------------------------------------------------------------
2283
+ Article Load (0.2ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2284
+  (0.0ms) SAVEPOINT active_record_1
2285
+ SQL (0.3ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:48:21 UTC], ["updated_at", 2016-09-26 17:48:21 UTC]]
2286
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2287
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:48:21 -0300
2288
+ Processing by RailsSitemap::SitemapController#index as XML
2289
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2290
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2291
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2292
+ Completed 200 OK in 8ms (Views: 4.4ms | ActiveRecord: 0.1ms)
2293
+  (1.9ms) rollback transaction
2294
+  (0.1ms) begin transaction
2295
+ ----------------------------
2296
+ RailsSitemapTest: test_truth
2297
+ ----------------------------
2298
+  (0.1ms) rollback transaction
2299
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
2300
+  (0.1ms) begin transaction
2301
+ ----------------------------
2302
+ RailsSitemapTest: test_truth
2303
+ ----------------------------
2304
+  (0.1ms) rollback transaction
2305
+  (0.1ms) begin transaction
2306
+ -------------------------------------------------------
2307
+ SitemapControllerTest: test_should_return_the_right_xml
2308
+ -------------------------------------------------------
2309
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:48:35 -0300
2310
+ Processing by RailsSitemap::SitemapController#index as XML
2311
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2312
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2313
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2314
+ Completed 200 OK in 13ms (Views: 8.2ms | ActiveRecord: 0.3ms)
2315
+  (0.2ms) rollback transaction
2316
+  (0.1ms) begin transaction
2317
+ --------------------------------------------------------
2318
+ SitemapControllerTest: test_should_return_a_success_code
2319
+ --------------------------------------------------------
2320
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:48:35 -0300
2321
+ Processing by RailsSitemap::SitemapController#index as XML
2322
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2323
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2324
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.7ms)
2325
+ Completed 200 OK in 10ms (Views: 7.9ms | ActiveRecord: 0.1ms)
2326
+  (0.1ms) rollback transaction
2327
+  (0.1ms) begin transaction
2328
+ -----------------------------------------------------------------
2329
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2330
+ -----------------------------------------------------------------
2331
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2332
+  (0.1ms) SAVEPOINT active_record_1
2333
+ SQL (0.3ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:48:35 UTC], ["updated_at", 2016-09-26 17:48:35 UTC]]
2334
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2335
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:48:35 -0300
2336
+ Processing by RailsSitemap::SitemapController#index as XML
2337
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2338
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2339
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.7ms)
2340
+ Completed 200 OK in 11ms (Views: 5.1ms | ActiveRecord: 0.1ms)
2341
+  (1.9ms) rollback transaction
2342
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
2343
+  (0.1ms) begin transaction
2344
+ ----------------------------
2345
+ RailsSitemapTest: test_truth
2346
+ ----------------------------
2347
+  (0.0ms) rollback transaction
2348
+  (0.0ms) begin transaction
2349
+ -------------------------------------------------------
2350
+ SitemapControllerTest: test_should_return_the_right_xml
2351
+ -------------------------------------------------------
2352
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:50:04 -0300
2353
+ Processing by RailsSitemap::SitemapController#index as XML
2354
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2355
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2356
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2357
+ Completed 200 OK in 12ms (Views: 7.0ms | ActiveRecord: 0.3ms)
2358
+  (0.2ms) rollback transaction
2359
+  (0.1ms) begin transaction
2360
+ --------------------------------------------------------
2361
+ SitemapControllerTest: test_should_return_a_success_code
2362
+ --------------------------------------------------------
2363
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:50:04 -0300
2364
+ Processing by RailsSitemap::SitemapController#index as XML
2365
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2366
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2367
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.6ms)
2368
+ Completed 200 OK in 8ms (Views: 5.3ms | ActiveRecord: 0.1ms)
2369
+  (0.1ms) rollback transaction
2370
+  (0.1ms) begin transaction
2371
+ -----------------------------------------------------------------
2372
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2373
+ -----------------------------------------------------------------
2374
+ Article Load (0.3ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2375
+  (0.0ms) SAVEPOINT active_record_1
2376
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:50:04 UTC], ["updated_at", 2016-09-26 17:50:04 UTC]]
2377
+  (0.1ms) RELEASE SAVEPOINT active_record_1
2378
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:50:04 -0300
2379
+ Processing by RailsSitemap::SitemapController#index as XML
2380
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2381
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2382
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.6ms)
2383
+ Completed 200 OK in 8ms (Views: 4.5ms | ActiveRecord: 0.1ms)
2384
+  (1.6ms) rollback transaction
2385
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2386
+  (0.1ms) begin transaction
2387
+ ----------------------------
2388
+ RailsSitemapTest: test_truth
2389
+ ----------------------------
2390
+  (0.0ms) rollback transaction
2391
+  (0.1ms) begin transaction
2392
+ -------------------------------------------------------
2393
+ SitemapControllerTest: test_should_return_the_right_xml
2394
+ -------------------------------------------------------
2395
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:50:34 -0300
2396
+ Processing by RailsSitemap::SitemapController#index as XML
2397
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2398
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2399
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2400
+ Completed 200 OK in 12ms (Views: 7.5ms | ActiveRecord: 0.2ms)
2401
+  (0.2ms) rollback transaction
2402
+  (0.1ms) begin transaction
2403
+ --------------------------------------------------------
2404
+ SitemapControllerTest: test_should_return_a_success_code
2405
+ --------------------------------------------------------
2406
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:50:34 -0300
2407
+ Processing by RailsSitemap::SitemapController#index as XML
2408
+ Article Load (0.2ms) SELECT "articles".* FROM "articles"
2409
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2410
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.7ms)
2411
+ Completed 200 OK in 12ms (Views: 9.3ms | ActiveRecord: 0.2ms)
2412
+  (0.1ms) rollback transaction
2413
+  (0.1ms) begin transaction
2414
+ -----------------------------------------------------------------
2415
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2416
+ -----------------------------------------------------------------
2417
+ Article Load (0.3ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2418
+  (0.1ms) SAVEPOINT active_record_1
2419
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:50:34 UTC], ["updated_at", 2016-09-26 17:50:34 UTC]]
2420
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2421
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:50:34 -0300
2422
+ Processing by RailsSitemap::SitemapController#index as XML
2423
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2424
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2425
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.6ms)
2426
+ Completed 200 OK in 8ms (Views: 4.9ms | ActiveRecord: 0.1ms)
2427
+  (1.8ms) rollback transaction
2428
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2429
+  (0.1ms) begin transaction
2430
+ --------------------------------------------------------
2431
+ SitemapControllerTest: test_should_return_a_success_code
2432
+ --------------------------------------------------------
2433
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:51:08 -0300
2434
+ Processing by RailsSitemap::SitemapController#index as XML
2435
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2436
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2437
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.4ms)
2438
+ Completed 200 OK in 20ms (Views: 8.8ms | ActiveRecord: 0.2ms)
2439
+  (0.1ms) rollback transaction
2440
+  (0.1ms) begin transaction
2441
+ -----------------------------------------------------------------
2442
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2443
+ -----------------------------------------------------------------
2444
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2445
+  (0.1ms) SAVEPOINT active_record_1
2446
+ SQL (0.3ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:51:08 UTC], ["updated_at", 2016-09-26 17:51:08 UTC]]
2447
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2448
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:51:08 -0300
2449
+ Processing by RailsSitemap::SitemapController#index as XML
2450
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2451
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2452
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2453
+ Completed 200 OK in 7ms (Views: 4.5ms | ActiveRecord: 0.1ms)
2454
+  (1.6ms) rollback transaction
2455
+  (0.1ms) begin transaction
2456
+ -------------------------------------------------------
2457
+ SitemapControllerTest: test_should_return_the_right_xml
2458
+ -------------------------------------------------------
2459
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:51:08 -0300
2460
+ Processing by RailsSitemap::SitemapController#index as XML
2461
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2462
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2463
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.2ms)
2464
+ Completed 200 OK in 10ms (Views: 7.5ms | ActiveRecord: 0.1ms)
2465
+  (0.1ms) rollback transaction
2466
+  (0.1ms) begin transaction
2467
+ ----------------------------
2468
+ RailsSitemapTest: test_truth
2469
+ ----------------------------
2470
+  (0.1ms) rollback transaction
2471
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2472
+  (0.1ms) begin transaction
2473
+ ----------------------------
2474
+ RailsSitemapTest: test_truth
2475
+ ----------------------------
2476
+  (0.1ms) rollback transaction
2477
+  (0.1ms) begin transaction
2478
+ --------------------------------------------------------
2479
+ SitemapControllerTest: test_should_return_a_success_code
2480
+ --------------------------------------------------------
2481
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:52:32 -0300
2482
+ Processing by RailsSitemap::SitemapController#index as XML
2483
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2484
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2485
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2486
+ Completed 200 OK in 18ms (Views: 6.7ms | ActiveRecord: 0.3ms)
2487
+  (0.1ms) rollback transaction
2488
+  (0.0ms) begin transaction
2489
+ -----------------------------------------------------------------
2490
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2491
+ -----------------------------------------------------------------
2492
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2493
+  (0.0ms) SAVEPOINT active_record_1
2494
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:52:32 UTC], ["updated_at", 2016-09-26 17:52:32 UTC]]
2495
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2496
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:52:32 -0300
2497
+ Processing by RailsSitemap::SitemapController#index as XML
2498
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2499
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2500
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.7ms)
2501
+ Completed 200 OK in 8ms (Views: 5.0ms | ActiveRecord: 0.1ms)
2502
+  (1.7ms) rollback transaction
2503
+  (0.1ms) begin transaction
2504
+ -------------------------------------------------------
2505
+ SitemapControllerTest: test_should_return_the_right_xml
2506
+ -------------------------------------------------------
2507
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:52:32 -0300
2508
+ Processing by RailsSitemap::SitemapController#index as XML
2509
+ Article Load (0.2ms) SELECT "articles".* FROM "articles"
2510
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2511
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.6ms)
2512
+ Completed 200 OK in 8ms (Views: 5.2ms | ActiveRecord: 0.2ms)
2513
+  (0.1ms) rollback transaction
2514
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2515
+  (0.1ms) begin transaction
2516
+ -----------------------------------------------------------------
2517
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2518
+ -----------------------------------------------------------------
2519
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2520
+  (0.0ms) SAVEPOINT active_record_1
2521
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:54:55 UTC], ["updated_at", 2016-09-26 17:54:55 UTC]]
2522
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2523
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:54:55 -0300
2524
+ Processing by RailsSitemap::SitemapController#index as XML
2525
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2526
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2527
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2528
+ Completed 200 OK in 10ms (Views: 7.0ms | ActiveRecord: 0.1ms)
2529
+  (1.7ms) rollback transaction
2530
+  (0.1ms) begin transaction
2531
+ -------------------------------------------------------
2532
+ SitemapControllerTest: test_should_return_the_right_xml
2533
+ -------------------------------------------------------
2534
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:54:55 -0300
2535
+ Processing by RailsSitemap::SitemapController#index as XML
2536
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2537
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2538
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.8ms)
2539
+ Completed 200 OK in 8ms (Views: 5.6ms | ActiveRecord: 0.1ms)
2540
+  (0.1ms) rollback transaction
2541
+  (0.1ms) begin transaction
2542
+ --------------------------------------------------------
2543
+ SitemapControllerTest: test_should_return_a_success_code
2544
+ --------------------------------------------------------
2545
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:54:55 -0300
2546
+ Processing by RailsSitemap::SitemapController#index as XML
2547
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2548
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2549
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2550
+ Completed 200 OK in 7ms (Views: 4.9ms | ActiveRecord: 0.1ms)
2551
+  (0.1ms) rollback transaction
2552
+  (0.1ms) begin transaction
2553
+ ----------------------------
2554
+ RailsSitemapTest: test_truth
2555
+ ----------------------------
2556
+  (0.1ms) rollback transaction
2557
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2558
+  (0.1ms) begin transaction
2559
+ ----------------------------
2560
+ RailsSitemapTest: test_truth
2561
+ ----------------------------
2562
+  (0.1ms) rollback transaction
2563
+  (0.0ms) begin transaction
2564
+ --------------------------------------------------------
2565
+ SitemapControllerTest: test_should_return_a_success_code
2566
+ --------------------------------------------------------
2567
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:56:28 -0300
2568
+ Processing by RailsSitemap::SitemapController#index as XML
2569
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2570
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2571
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2572
+ Completed 200 OK in 12ms (Views: 7.3ms | ActiveRecord: 0.3ms)
2573
+  (0.1ms) rollback transaction
2574
+  (0.1ms) begin transaction
2575
+ -------------------------------------------------------
2576
+ SitemapControllerTest: test_should_return_the_right_xml
2577
+ -------------------------------------------------------
2578
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:56:28 -0300
2579
+ Processing by RailsSitemap::SitemapController#index as XML
2580
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2581
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2582
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2583
+ Completed 200 OK in 6ms (Views: 4.4ms | ActiveRecord: 0.1ms)
2584
+  (0.0ms) rollback transaction
2585
+  (0.1ms) begin transaction
2586
+ -----------------------------------------------------------------
2587
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2588
+ -----------------------------------------------------------------
2589
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2590
+  (0.0ms) SAVEPOINT active_record_1
2591
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:56:28 UTC], ["updated_at", 2016-09-26 17:56:28 UTC]]
2592
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2593
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:56:28 -0300
2594
+ Processing by RailsSitemap::SitemapController#index as XML
2595
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2596
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2597
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2598
+ Completed 200 OK in 7ms (Views: 4.2ms | ActiveRecord: 0.1ms)
2599
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" ORDER BY "articles"."id" DESC LIMIT ? [["LIMIT", 1]]
2600
+  (2.1ms) rollback transaction
2601
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
2602
+  (0.1ms) begin transaction
2603
+ --------------------------------------------------------
2604
+ SitemapControllerTest: test_should_return_a_success_code
2605
+ --------------------------------------------------------
2606
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:56:33 -0300
2607
+ Processing by RailsSitemap::SitemapController#index as XML
2608
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2609
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2610
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (1.1ms)
2611
+ Completed 200 OK in 11ms (Views: 7.0ms | ActiveRecord: 0.2ms)
2612
+  (0.1ms) rollback transaction
2613
+  (0.1ms) begin transaction
2614
+ -----------------------------------------------------------------
2615
+ SitemapControllerTest: test_should_return_the_articles_on_sitemap
2616
+ -----------------------------------------------------------------
2617
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" WHERE "articles"."name" = ? LIMIT ? [["name", "My first article"], ["LIMIT", 1]]
2618
+  (0.0ms) SAVEPOINT active_record_1
2619
+ SQL (0.2ms) INSERT INTO "articles" ("name", "created_at", "updated_at") VALUES (?, ?, ?) [["name", "My first article"], ["created_at", 2016-09-26 17:56:33 UTC], ["updated_at", 2016-09-26 17:56:33 UTC]]
2620
+  (0.0ms) RELEASE SAVEPOINT active_record_1
2621
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:56:33 -0300
2622
+ Processing by RailsSitemap::SitemapController#index as XML
2623
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2624
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2625
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.5ms)
2626
+ Completed 200 OK in 7ms (Views: 4.3ms | ActiveRecord: 0.1ms)
2627
+ Article Load (0.1ms) SELECT "articles".* FROM "articles" ORDER BY "articles"."id" DESC LIMIT ? [["LIMIT", 1]]
2628
+  (2.0ms) rollback transaction
2629
+  (0.1ms) begin transaction
2630
+ -------------------------------------------------------
2631
+ SitemapControllerTest: test_should_return_the_right_xml
2632
+ -------------------------------------------------------
2633
+ Started GET "/sitemap.xml" for 127.0.0.1 at 2016-09-26 14:56:33 -0300
2634
+ Processing by RailsSitemap::SitemapController#index as XML
2635
+ Article Load (0.1ms) SELECT "articles".* FROM "articles"
2636
+ Rendering /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb
2637
+ Rendered /Users/pgonzaga/repositories/rails_sitemap/app/views/rails_sitemap/sitemap/index.xml.erb (0.4ms)
2638
+ Completed 200 OK in 6ms (Views: 4.1ms | ActiveRecord: 0.1ms)
2639
+  (0.0ms) rollback transaction
2640
+  (0.0ms) begin transaction
2641
+ ----------------------------
2642
+ RailsSitemapTest: test_truth
2082
2643
  ----------------------------
2083
2644
   (0.0ms) rollback transaction
@@ -14,6 +14,6 @@ class SitemapControllerTest < ActionDispatch::IntegrationTest
14
14
  test 'should return the articles on sitemap' do
15
15
  Article.find_or_create_by(name: 'My first article')
16
16
  get '/sitemap.xml'
17
- assert_equal response.body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:geo=\"http://www.google.com/geo/schemas/sitemap/1.0\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:mobile=\"http://www.google.com/schemas/sitemap-mobile/1.0\" xmlns:news=\"http://www.google.com/schemas/sitemap-news/0.9\" xmlns:pagemap=\"http://www.google.com/schemas/sitemap-pagemap/1.0\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n <url>\n <loc>http://www.example.com</loc>\n <lastmod>2016-09-22T18:11:05-03:00</lastmod>\n <changefreq>always</changefreq>\n <priority>1.0</priority>\n </url>\n\n <url>\n <loc>http://www.example.com/articles</loc>\n <lastmod>2016-09-22T18:11:05-03:00</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.5</priority>\n </url>\n <url>\n <loc>http://www.example.com/articles/1</loc>\n <lastmod>2016-09-22T18:11:05-03:00</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.5</priority>\n </url>\n</urlset>\n"
17
+ assert_equal response.body, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:geo=\"http://www.google.com/geo/schemas/sitemap/1.0\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\" xmlns:mobile=\"http://www.google.com/schemas/sitemap-mobile/1.0\" xmlns:news=\"http://www.google.com/schemas/sitemap-news/0.9\" xmlns:pagemap=\"http://www.google.com/schemas/sitemap-pagemap/1.0\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\">\n <url>\n <loc>http://www.example.com</loc>\n <lastmod>2016-09-22T18:11:05-03:00</lastmod>\n <changefreq>always</changefreq>\n <priority>1.0</priority>\n </url>\n\n <url>\n <loc>http://www.example.com/articles</loc>\n <lastmod>2016-09-22T18:11:05-03:00</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.5</priority>\n </url>\n <url>\n <loc>http://www.example.com/articles/1</loc>\n <lastmod>" + Article.last.updated_at.to_datetime.to_s + "</lastmod>\n <changefreq>weekly</changefreq>\n <priority>0.5</priority>\n </url>\n</urlset>\n"
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Gonzaga
@@ -52,6 +52,7 @@ files:
52
52
  - app/controllers/rails_sitemap/application_controller.rb
53
53
  - app/controllers/rails_sitemap/sitemap_controller.rb
54
54
  - app/helpers/rails_sitemap/application_helper.rb
55
+ - app/models/rails_sitemap/sitemap_entry.rb
55
56
  - app/views/layouts/rails_sitemap/application.html.erb
56
57
  - app/views/rails_sitemap/sitemap/index.xml.erb
57
58
  - config/routes.rb