From 243937fdb9acf6c5e1faee4addc602e9d5cc3baa Mon Sep 17 00:00:00 2001 From: Arturs Krapans Date: Sun, 25 Jun 2023 18:34:11 +0300 Subject: [PATCH] Fixes controller name in tests --- test/controllers/feed_controller_spec.rb | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/controllers/feed_controller_spec.rb diff --git a/test/controllers/feed_controller_spec.rb b/test/controllers/feed_controller_spec.rb new file mode 100644 index 00000000..72e17547 --- /dev/null +++ b/test/controllers/feed_controller_spec.rb @@ -0,0 +1,29 @@ +require "test_helper" + +class FeedControllerTest < ActionDispatch::IntegrationTest + setup do + @talks = talks(:one, :two) + frozen_date_time = DateTime.new(2022, 1, 15, 10, 0, 0) + @talks.each do |talk| + talk.update!(created_at: frozen_date_time, updated_at: frozen_date_time) + end + end + + test "should get rss format" do + get feed_url(format: :rss) + + assert_response :success + assert_equal "/feed.rss", path + assert_equal "application/rss+xml; charset=utf-8", response.content_type + assert_equal File.read("test/fixtures/files/feed.rss"), response.parsed_body + end + + test "should get atom format" do + get feed_url(format: :atom) + + assert_response :success + assert_equal "/feed.atom", path + assert_equal "application/atom+xml; charset=utf-8", response.content_type + assert_equal File.read("test/fixtures/files/feed.atom"), response.parsed_body + end +end