refactor static-pages controller test
add some test helpers including guard