On Monday, 8 September 2014 at 9:04, Cynthia Kiser wrote:
I am trying to test that a particular Rails controller action deletes all items and then recreates them from an RSS feed. The new class_spy method seemed just perfect for what I was trying to do but I can't get it to work. What am I misunderstanding from the docs?--/app/controllers/news_configuration_controller.rbclass NewsConfigurationController < ApplicationController# GET /news_configuration/refresh_from_wwwdef refresh_from_wwwNewsRelease.delete_allredirect_to news_configuration_pathendend
/spec/controllers/news_configuration_controller_spec.rbRSpec.describe NewsConfigurationController, :type => :controller dodescribe "GET 'refresh_from_www'" doit "refreshes news releases" donews_release_class = class_spy("NewsRelease")get :refresh_from_www, { }, valid_sessionexpect(news_release_class).to have_received(:delete_all)end
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/4447f117-4857-46eb-9c49-44fab1ca5bfb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.