[Collaboa] Question on submitting patches

Courtenay court3nay at gmail.com
Thu Dec 14 23:28:43 GMT 2006


assert_select is also pretty powerful/simple once you get the hang of
it.  CSS selectors are like regular expressions in that way.

You can also nest them to make the logic simpler.

assert_select "form[id=monkey_form][action='/monkeys']" do |f|
  assert_select f, "input[type=text][name='monkey[name]']"
end


On 12/14/06, Jason Garber <jason.garber at emu.edu> wrote:
> Olly's right, testing everything that's purely in the views is
> probably overkill, but if in doubt, err in the direction of more tests.
>
> My rule of thumb is, "Only add tests for that which you wouldn't want
> someone else breaking."  So, if I want message X displayed to the
> user when condition Y is true, I'm going to write a test for it.  I'm
> not going to write a test, however, for wording or layout/design
> stuff.  If a coworker changes "Zip code" to "Postal code," the app
> isn't broken and I don't really care.  If he removed some display
> logic and caused admin-only stuff to be exposed to the world, though,
> I'd be pretty steamed, so I'd better write a test for it.
>
> Clear as mud? :-)
>
> On Dec 14, 2006, at 1:24 PM, Oliver Legg wrote:
>
> > It's probably unnecessary to include any testing for changes to the
> > views.
> >
> > If it is only a small change I wouldnt bother. However if it is large
> > you might wish to include testing, so that the tests can be used in
> > the future to ensure the view stays the same.
> >
> > However this presents a further problem, the method of testing views
> > changes from 1.1 to 1.2 with assert_tag becoming deprecated; in favor
> > of assert_select (?).
> >
> > This doesn't really offer any suggestions but hopefully gives you a
> > few hints.
> >
> > Olly
> >
> > On 14 Dec 2006, at 16:53, Peer Allan wrote:
> >
> >> Hello all,
> >>
> >> If I want to submit a patch for something that just modifies a
> >> view, such as
> >> added additional text, how would I include a test for that?
> >>
> >> I am just getting an handle on testing in rails, so I apologize if
> >> this is a
> >> RTFM question. Thanks
> >>
> >> Peer
> >>
> >>
> >> _______________________________________________
> >> Collaboa-talk mailing list
> >> Collaboa-talk at lists.collaboa.org
> >> http://lists.collaboa.org/mailman/listinfo/collaboa-talk
> >
> > _______________________________________________
> > Collaboa-talk mailing list
> > Collaboa-talk at lists.collaboa.org
> > http://lists.collaboa.org/mailman/listinfo/collaboa-talk
>
> _______________________________________________
> Collaboa-talk mailing list
> Collaboa-talk at lists.collaboa.org
> http://lists.collaboa.org/mailman/listinfo/collaboa-talk
>


More information about the Collaboa-talk mailing list