From 2934bea7db2d095553e4cb311235e5cb0b089675 Mon Sep 17 00:00:00 2001 From: Joerg Reichert Date: Sun, 10 Apr 2016 14:47:22 +0200 Subject: [PATCH] test RSS format --- spec/controllers/search_controller_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 4db4133..81dcdce 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -28,6 +28,21 @@ RSpec.describe SearchController, type: :controller, elasticsearch: true do get :index, body: 'leipzig' end + + it "returns rss" do + get :index, :format => "rss", body: 'leipzig' + expect(response).to be_success + expect(response).to render_template(:index) + expect(response.content_type).to eq("application/rss+xml") + expect(response.body).to have_tag "rss" do + with_tag "channel" do + with_tag "title" + with_tag "description" + with_tag "link" + end + end + end + end end