Re: [rspec-users] testing instance variables that are set inside views

2007-07-04 Thread David Chelimsky
On 7/4/07, Patrick Ritchie <[EMAIL PROTECTED]> wrote: > > Hi Don, > > Thanks for the tip! That looks like a great way to handle this case. > > So what does everybody think, is this the definitive answer for setting > instance variables in your views? (use a helper) or are their cases where we >

Re: [rspec-users] testing instance variables that are set inside views

2007-07-04 Thread Patrick Ritchie
Hi Don, Thanks for the tip! That looks like a great way to handle this case. So what does everybody think, is this the definitive answer for setting instance variables in your views? (use a helper) or are their cases where we may still want to check instance variables in view specs? Cheers!

Re: [rspec-users] testing instance variables that are set inside views

2007-07-04 Thread Don Petersen
I can sympathize with not wanting to just verify the final html output, even though it would probably be sufficient in this simple case. I'm a big fan of helpers for any logic in views, even simple stuff like this. If you had a couple of methods in your ApplicationHelper that handled settin

Re: [rspec-users] testing instance variables that are set inside views

2007-07-04 Thread Patrick Ritchie
David Chelimsky wrote: On 7/4/07, Patrick Ritchie <[EMAIL PROTECTED]> wrote: aslak hellesoy wrote: On 7/3/07, Patrick Ritchie <[EMAIL PROTECTED]> wrote: Hi, I think @header may not be an implementation detail in this case. If your layout looks like this: ... <%= @header || 'Defa

Re: [rspec-users] testing instance variables that are set inside views

2007-07-04 Thread David Chelimsky
On 7/4/07, Patrick Ritchie <[EMAIL PROTECTED]> wrote: > > aslak hellesoy wrote: > On 7/3/07, Patrick Ritchie <[EMAIL PROTECTED]> wrote: > > > Hi, > > I think @header may not be an implementation detail in this case. > > If your layout looks like this: > > ... > > <%= @header || 'Default Ti

Re: [rspec-users] testing instance variables that are set inside views

2007-07-04 Thread Patrick Ritchie
aslak hellesoy wrote: On 7/3/07, Patrick Ritchie <[EMAIL PROTECTED]> wrote: Hi, I think @header may not be an implementation detail in this case. If your layout looks like this: ... <%= @header || 'Default Title' %> ... And the view we are testing looks like this: ... <%= @h

Re: [rspec-users] testing instance variables that are set inside views

2007-07-04 Thread aslak hellesoy
On 7/3/07, Patrick Ritchie <[EMAIL PROTECTED]> wrote: > > Hi, > > I think @header may not be an implementation detail in this case. > > If your layout looks like this: > > ... > > <%= @header || 'Default Title' %> > > ... > > And the view we are testing looks like this: > > ... > <%= @

Re: [rspec-users] testing instance variables that are set inside views

2007-07-03 Thread Patrick Ritchie
Hi, I think @header may not be an implementation detail in this case. If your layout looks like this: ... <%= @header || 'Default Title' %> ... And the view we are testing looks like this: ... <%= @header = 'Specific Title'> ... Then setting @header is an essential behavior for the view sp

Re: [rspec-users] testing instance variables that are set inside views

2007-07-01 Thread barsalou
Quoting David Chelimsky <[EMAIL PROTECTED]>: >>> >> Thanks Aslak, I wondered this myself. I looked around here : >> http://rspec.rubyforge.org/rdoc/index.html for have_tag but didn't find >> it. >> >> Where would be a good place to find some of these matchers? > > have_tag is not part of rspec's

Re: [rspec-users] testing instance variables that are set inside views

2007-06-30 Thread David Chelimsky
On 6/30/07, barsalou <[EMAIL PROTECTED]> wrote: > Quoting aslak hellesoy <[EMAIL PROTECTED]>: > > > @header is an implementation detail of your view that you shouldn't > > care about in your view spec at all. I recommend you use the have_tag > > matcher instead to verify what content gets rendered

Re: [rspec-users] testing instance variables that are set inside views

2007-06-30 Thread barsalou
Quoting aslak hellesoy <[EMAIL PROTECTED]>: > @header is an implementation detail of your view that you shouldn't > care about in your view spec at all. I recommend you use the have_tag > matcher instead to verify what content gets rendered as expected. > > Aslak > Thanks Aslak, I wondered this m

Re: [rspec-users] testing instance variables that are set inside views

2007-06-30 Thread aslak hellesoy
@header is an implementation detail of your view that you shouldn't care about in your view spec at all. I recommend you use the have_tag matcher instead to verify what content gets rendered as expected. Aslak On 6/29/07, Jeremy Stephens <[EMAIL PROTECTED]> wrote: > Hi all, > > In my view specs (