Skip to content

Commit e9cbc2f

Browse files
authored
Minor fixes (#37)
Add no index header on RSS feed to prevent google wasting time on it and fixes some test compiler warnings
1 parent 035a6e2 commit e9cbc2f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/jola_dev_web/controllers/rss_controller.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ defmodule JolaDevWeb.RssController do
66

77
conn
88
|> put_resp_content_type("application/rss+xml")
9+
|> put_resp_header("x-robots-tag", "noindex")
910
|> render(:index, posts: posts)
1011
end
1112
end

test/jola_dev/blog_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule JolaDev.BlogTest do
77
posts = Blog.all_posts()
88

99
assert is_list(posts)
10-
assert posts != []
10+
assert [_ | _] = posts
1111

1212
# Verify posts are sorted by date in descending order
1313
dates = Enum.map(posts, & &1.date)
@@ -20,7 +20,7 @@ defmodule JolaDev.BlogTest do
2020
tags = Blog.all_tags()
2121

2222
assert is_list(tags)
23-
assert tags != []
23+
assert [_ | _] = tags
2424
assert tags == Enum.uniq(tags)
2525
assert tags == Enum.sort(tags)
2626
end

0 commit comments

Comments
 (0)