Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Unit test support for page views

Hello, I'd like to be able to write unit tests so that I could call a couple pages and check for 200 response codes and fail if I get anything else (like 400 or 5xx response codes). Not sure how I could do this with a unit test framework or what url I would even call.
This would be super useful so that I can catch errors and stop deployments.

  1. Hi Andrew

    The tests you describe sound more like integration- or regression tests and should not be executed during unit testing. I'd recommend refactoring your unit tests to test functionality at a lower level than hitting urls and running your regression tests once you have deployed.

  2. friism closed this discussion on 09 May, 2011 03:17 PM.

  3. andrew re-opened this discussion on 09 May, 2011 06:25 PM

  4. Hi Michael, thanks for your response. I wanted to be able to catch errors in my views that were not integration level tests, for example I forgot a closing ) in an if statement in my razor view.

    I did see Haacked's post today which helps me with that though: http://haacked.com/archive/2011/05/09/compiling-mvc-views-in-a-buil...

  5. Cool -- we actually had view-precompilation enabled for all apps at some point, but hit some snag (I forget which).

    Let us know if you other questions.

  6. friism closed this discussion on 09 May, 2011 06:30 PM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac