Re: [rspec-users] Help to spec a rails helper method that uses content_for

2011-05-25 Thread Justin Ko
On Tue, May 24, 2011 at 10:34 PM, Paul P. wrote: > John, > > I know this is quite old, but I wanted to apply your same example in > Rspec 2. I'm getting the following when I attempt to do so. > > application_helper.rb > === > module ApplicationHelper > > # Return a titl

Re: [rspec-users] Help to spec a rails helper method that uses content_for

2011-05-24 Thread Paul P.
John, I know this is quite old, but I wanted to apply your same example in Rspec 2. I'm getting the following when I attempt to do so. application_helper.rb === module ApplicationHelper # Return a title on a per-page basis. def title(page_title) content_for(:t

Re: [rspec-users] Help to spec a rails helper method that uses content_for

2008-01-27 Thread John D. Hume
Ben, You're trying to test more than one thing in one spec. The gutter that's steered you into here is that you're looking for side-effects of a method you've mocked. Your spec says to make sure the template calls "body_class" and to have the call return a string, but that's not how the body_clas

[rspec-users] Help to spec a rails helper method that uses content_for

2008-01-24 Thread Ben Aldred
Hi guys, I am a Rspec newbie and am having problems creating a spec for a RoR helper method. I have in fact already implemented the helper method and am trying to create retrospective specs. I know its the wrong way to do it but I am still learning Rspec. In my view I have a call to a helper met