[rspec-users] rspec controller action list

Namrata Tiwari lists at ruby-forum.com
Thu Feb 28 23:27:02 EST 2008


Thanks Mr David for your reply. This gives me a better understanding of 
so called train wreck. I am still facing problems with this spec.
firstly - I think I need to put a colon before order(e.g. :order=> 
"live_on DESC")

#list
  it "should list all articles" do
    articles = mock("articles")
    articles.should_receive(:paginate).with(:order => "live_on DESC", 
:conditions => { :type_for => "blog" })
    controller.should_receive(:find_city).and_return(articles)
    get :list
  end


but this gives me the following error
Spec::Mocks::MockExpectationError in 'ArticlesController should list all 
article
s'
Mock 'ArticlesController' expected :find_city with (any args) once, but 
received
 it 0 times
spec/controllers/articles_controller_spec.rb:3:

Thanks,
Namrata.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list