rails_sitemap 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ one:
2
+ name: MyFirstArticle
3
+ slug: my-first-article
4
+
5
+ two:
6
+ name: MySecondArticle
7
+ slug: my-second-article
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class ArticleTest < ActiveSupport::TestCase
4
+ end
@@ -10,4 +10,10 @@ class SitemapControllerTest < ActionDispatch::IntegrationTest
10
10
  get '/sitemap.xml'
11
11
  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</urlset>\n"
12
12
  end
13
+
14
+ test 'should return the articles on sitemap' do
15
+ Article.find_or_create_by(name: 'My first article')
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"
18
+ end
13
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Gonzaga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-23 00:00:00.000000000 Z
11
+ date: 2016-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -46,7 +46,6 @@ extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
48
  - MIT-LICENSE
49
- - README.rdoc
50
49
  - Rakefile
51
50
  - app/assets/javascripts/rails_sitemap/application.js
52
51
  - app/assets/stylesheets/rails_sitemap/application.css
@@ -59,7 +58,7 @@ files:
59
58
  - lib/rails_sitemap.rb
60
59
  - lib/rails_sitemap/engine.rb
61
60
  - lib/rails_sitemap/version.rb
62
- - lib/tasks/rails_sitemap_tasks.rake
61
+ - lib/tasks/rails_sitemap_installer.rake
63
62
  - test/dummy/README.rdoc
64
63
  - test/dummy/Rakefile
65
64
  - test/dummy/app/assets/javascripts/application.js
@@ -67,6 +66,8 @@ files:
67
66
  - test/dummy/app/controllers/application_controller.rb
68
67
  - test/dummy/app/controllers/articles_controller.rb
69
68
  - test/dummy/app/helpers/application_helper.rb
69
+ - test/dummy/app/models/application_record.rb
70
+ - test/dummy/app/models/article.rb
70
71
  - test/dummy/app/views/articles/index.html.erb
71
72
  - test/dummy/app/views/articles/show.html.erb
72
73
  - test/dummy/app/views/layouts/application.html.erb
@@ -88,12 +89,15 @@ files:
88
89
  - test/dummy/config/initializers/filter_parameter_logging.rb
89
90
  - test/dummy/config/initializers/inflections.rb
90
91
  - test/dummy/config/initializers/mime_types.rb
92
+ - test/dummy/config/initializers/rails_sitemap.rb
91
93
  - test/dummy/config/initializers/session_store.rb
92
94
  - test/dummy/config/initializers/wrap_parameters.rb
93
95
  - test/dummy/config/locales/en.yml
94
96
  - test/dummy/config/routes.rb
95
97
  - test/dummy/config/secrets.yml
96
98
  - test/dummy/db/development.sqlite3
99
+ - test/dummy/db/migrate/20160926151250_create_articles.rb
100
+ - test/dummy/db/migrate/20160926153532_remove_slug_from_article.rb
97
101
  - test/dummy/db/schema.rb
98
102
  - test/dummy/db/test.sqlite3
99
103
  - test/dummy/log/development.log
@@ -102,6 +106,8 @@ files:
102
106
  - test/dummy/public/422.html
103
107
  - test/dummy/public/500.html
104
108
  - test/dummy/public/favicon.ico
109
+ - test/dummy/test/fixtures/articles.yml
110
+ - test/dummy/test/models/article_test.rb
105
111
  - test/integration/sitemap_controller_test.rb
106
112
  - test/rails_sitemap_test.rb
107
113
  - test/test_helper.rb
@@ -135,6 +141,8 @@ test_files:
135
141
  - test/dummy/app/controllers/application_controller.rb
136
142
  - test/dummy/app/controllers/articles_controller.rb
137
143
  - test/dummy/app/helpers/application_helper.rb
144
+ - test/dummy/app/models/application_record.rb
145
+ - test/dummy/app/models/article.rb
138
146
  - test/dummy/app/views/articles/index.html.erb
139
147
  - test/dummy/app/views/articles/show.html.erb
140
148
  - test/dummy/app/views/layouts/application.html.erb
@@ -155,6 +163,7 @@ test_files:
155
163
  - test/dummy/config/initializers/filter_parameter_logging.rb
156
164
  - test/dummy/config/initializers/inflections.rb
157
165
  - test/dummy/config/initializers/mime_types.rb
166
+ - test/dummy/config/initializers/rails_sitemap.rb
158
167
  - test/dummy/config/initializers/session_store.rb
159
168
  - test/dummy/config/initializers/wrap_parameters.rb
160
169
  - test/dummy/config/locales/en.yml
@@ -162,6 +171,8 @@ test_files:
162
171
  - test/dummy/config/secrets.yml
163
172
  - test/dummy/config.ru
164
173
  - test/dummy/db/development.sqlite3
174
+ - test/dummy/db/migrate/20160926151250_create_articles.rb
175
+ - test/dummy/db/migrate/20160926153532_remove_slug_from_article.rb
165
176
  - test/dummy/db/schema.rb
166
177
  - test/dummy/db/test.sqlite3
167
178
  - test/dummy/log/development.log
@@ -172,6 +183,8 @@ test_files:
172
183
  - test/dummy/public/favicon.ico
173
184
  - test/dummy/Rakefile
174
185
  - test/dummy/README.rdoc
186
+ - test/dummy/test/fixtures/articles.yml
187
+ - test/dummy/test/models/article_test.rb
175
188
  - test/integration/sitemap_controller_test.rb
176
189
  - test/rails_sitemap_test.rb
177
190
  - test/test_helper.rb
data/README.rdoc DELETED
@@ -1,15 +0,0 @@
1
- = RailsSitemap
2
-
3
- ## Instalation
4
-
5
- Add the gem in your Gemfile
6
-
7
- ```ruby
8
- gem 'rails_sitemap'
9
- ```
10
-
11
- Mount the engine on your rails application
12
-
13
- ```ruby
14
- mount RailsSitemap::Engine => "/"
15
- ```
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :rails_sitemap do
3
- # # Task goes here
4
- # end