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] Aspects in RSpec 1.0.5

2007-07-04 Thread Ashley Moran
On 2 Jul 2007, at 10:22, David Chelimsky wrote: > IIRC, part of the facet idea was to prepend the facet text to the > descriptive string: > > describe XP do > facet "pair programming" do > it "should work better when team members have breath mints" do > end > end > end > > XP > - (pai

Re: [rspec-users] Aspects in RSpec 1.0.5

2007-07-04 Thread David Chelimsky
On 7/4/07, Ashley Moran <[EMAIL PROTECTED]> wrote: > > On 2 Jul 2007, at 10:22, David Chelimsky wrote: > > > IIRC, part of the facet idea was to prepend the facet text to the > > descriptive string: > > > > describe XP do > > facet "pair programming" do > > it "should work better when team me

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 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
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 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
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 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 >