sumeetjain / outcomes-tracker

0 stars 0 forks source link

An Entry can have one Position #9

Closed halfghaninne closed 8 years ago

halfghaninne commented 8 years ago
tsbutler commented 8 years ago

Forgive my ignorance, but what sort of tests are we looking for with this issue?

sumeetjain commented 8 years ago

@halfghaninne For you to clarify.

It's possible you were thinking about testing the interaction itself, of going to some page, filling out a form, and then expecting to see some content on the next page. If so, I might advise against that particular test for this scenario, since scaffolds are entirely a Rails feature and we don't need to retest their functionality.

I think we can confine tests to three buckets:

  1. Our own methods in models (so not all or where, since those aren't our own methods).
  2. Our own classes, e.g. some module or other lib file that we write.
  3. Some interactions, where we fill out forms and expect a particular output on the subsequent page. I'm not sure how often we'll want these, but we can case-by-case it.

If you had other thoughts versus the above, please share. Otherwise, maybe tests for this feature aren't as necessary as I'd originally thought (I say "I'd" because I had initially been pushing for maybe overly-comprehensive test coverage).

halfghaninne commented 8 years ago

I was thinking of interaction tests! I think testing forms is helpful in this case, since a new Position could potentially belong to an existing Entry, or create a whole new Entry upon its own creation. Maybe that's not as complicated as I'm making it out to be in my mind.

My thought process in writing tests on Issues was to not forget to do it if it does fit one of those three guidelines.

sumeetjain commented 8 years ago

Since the issue is just to scaffold the model with the properties you listed, it's not really clear what kind of interactions should be made possible for the resource. Could you add those in? I think those could then become the stem for whatever interaction tests you think are useful for this feature. That way Thorin can have a specific target for what to test, and we can help with the specifics of how to do it.

It might be good for you both to have a 20 minute session going over a 'Hello world!' template for interaction tests, since just getting started can be tough. Or maybe there's enough in the tests already (from tests you've already written) for Thorin to learn by example.

tsbutler commented 8 years ago

I'm amenable to either really.

halfghaninne commented 8 years ago

Updated the Issue. I've already done some integration tests in spec/features files. This tutorial among others was helpful.

sumeetjain commented 8 years ago

@tsbutler Take a look, and let us know if that's not enough for you to go on.

tsbutler commented 8 years ago

Will do. Thanks.