standard-library / microform

Tiny form object pattern for Rails
MIT License
0 stars 0 forks source link

Add controller test helper for asserting submissions #13

Closed jackjennings closed 7 years ago

jackjennings commented 7 years ago

This pull request addresses both #12 and #9. I've introduced a Microform::TestMethods module that can be included in a Minitest test suite. The added assert_submits method follows the syntax as discussed last in #9.

Questions: — Does the README language sufficiently describe both how and why tests can be written? — Should the name Microform::TestMethods mention that it is for controller/integration tests? I was thinking specifically about Rack::Test::Methods, though in that context the methods are more clearly meant for testing Rack apps. What happens if we want to introduce a test methods for form tests?

ghost commented 7 years ago

Questions:

— Does the README language sufficiently describe both how and why tests can be written? I think it's explained well! It might be worth mentioning that this is known to work in Minitest specifically. — Should the name Microform::TestMethods mention that it is for controller/integration tests? I was thinking specifically about Rack::Test::Methods, though in that context the methods are more clearly meant for testing Rack apps. What happens if we want to introduce a test methods for form tests? HMMM, I like the idea of controller/integration tests being mentioned, but can't think of a good word to use. Perhaps omit for now? What kind of names were you thinking of?

jackjennings commented 7 years ago

Could be Microform::Test::IntegrationMethods or Microform::TestMethods::Integration or Microform::Test::Integration?

jackjennings commented 7 years ago

I'll note that only Minitest is supported at this point.

ghost commented 7 years ago

I'm into Microform::Test::IntegrationMethods...

jackjennings commented 7 years ago

@skwak I made the requested changes. Want to take a last look over to see if I'm missing anything?