small medium large xlarge

Generic-user-small
19 Apr 2013, 20:36
Allan Berry (8 posts)

Following along with Agile Rails…

In the helper tests, the book uses an “@update” variable to seed the functional test:

@update = {
  title: 'Lorem Ipsum',
  description: 'Wibbles are fun!',
  image_url: 'lorem.jpg',
  price: 19.95
}

Why is this necessary, instead of using fixture data? I’m sure I’m misunderstanding something, so just trying to clear it up in my head.

I ask because the "should update product" test later on uses fixtures (and failed when they weren’t correct… I didn’t see it in the book, and had to sleuth it out).

Thanks very much for this excellent book!

Generic-user-small
19 Apr 2013, 22:04
Allan Berry (8 posts)

Ah, I see… fixtures get explained in the next section.

Not sure why the "should update product" test requires fixtures then. Maybe Rails changed after this Agile book reached publication?

Generic-user-small
19 Apr 2013, 22:21
Allan Berry (8 posts)

Hmm, and now I see that fixtures were used in the functional test setup… hmm. Must be just me, if everybody else gets it.

:/

  You must be logged in to comment