end
- private
+ # private
- def create_item
+ private def create_item
item = FeedItem.new(:feed_name => params[:feed_name],
:title => params[:title],
:description => params[:description])
end
- def update_item(item)
+ private def update_item(item)
if item.update_attribute(:description, params[:description])
flash[:notice] = "Element #{params[:title]} updated"
respond_to do |format|
end
- def destroy_item(item)
+ private def destroy_item(item)
if item.destroy
flash[:notice] = "Element #{params[:title]} deleted"
respond_to do |format|
let!(:feed_item2) { FactoryGirl.create(:feed_item,
feed_name: "test_feed", title: "item 2") }
- it "redirects an emtpy feed to the index" do
+ it "redirects an emtpy html feed to the index" do
get :show, feed_name: "empty_feed"
expect(response).to redirect_to(index_path)
end
+
+ it "returns an emtpy rss document for an empty feed" do
+ get :show, feed_name: "empty_feed", format: "rss"
+ expect(response.status).to be(200)
+ end
it "responds successfully with an HTTP 200 status code" do
get :show, feed_name: "test_feed"