From afef9cc9ab523b77824d88b11c2d07f4a37c7539 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 13 Jul 2020 19:30:40 -0500 Subject: [PATCH] tests: fix tests. --- app/views/static/sitemap_index.xml.erb | 2 +- test/unit/post_sets/post_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/static/sitemap_index.xml.erb b/app/views/static/sitemap_index.xml.erb index d779d41f7..eaae89833 100644 --- a/app/views/static/sitemap_index.xml.erb +++ b/app/views/static/sitemap_index.xml.erb @@ -4,7 +4,7 @@ <% 0.upto(@relation.maximum(:id) / @limit) do |page| %> <% lo = page * @limit %> <% hi = (page + 1) * @limit %> - <% lastmod = @relation.where(id: lo..hi).maximum(:updated_at).iso8601 %> + <% lastmod = @relation.where(id: lo..hi).maximum(:updated_at)&.iso8601 %> <% if @sitemap == "posts" %> <% loc = posts_url(limit: @limit, format: :sitemap, tags: "id:#{lo}..#{hi}") %> <% else %> diff --git a/test/unit/post_sets/post_test.rb b/test/unit/post_sets/post_test.rb index 146600981..77f88800a 100644 --- a/test/unit/post_sets/post_test.rb +++ b/test/unit/post_sets/post_test.rb @@ -129,6 +129,7 @@ module PostSets context "that has a matching artist" do setup do + Tag.find_by(name: "a").update!(category: Tag.categories.artist) @artist = FactoryBot.create(:artist, :name => "a") end