Just wondering what the recommended approach would be to carry out ad
hoc
testing of one’s application via the web interface, but noting you want
to
leverage use of the various test data you have put together in test
fixtures
(i.e. used for automated testing).
Would the concept be to use the test environment but run a unit test
first
which setup test data in the database via fixtures?
Just wondering what the recommended approach would be to carry out ad hoc
testing of one’s application via the web interface, but noting you want to
leverage use of the various test data you have put together in test fixtures
(i.e. used for automated testing).
Would the concept be to use the test environment but run a unit test first
which setup test data in the database via fixtures?
The old-school, pre-TDD technique here is to configure a
development-only mode for the site. I use a CSS class of
‘developmental’, and set it to display:none in production mode.
Then I put a couple extra buttons in the banner that load sample data
and trigger various states.
I can’t use db:fixtures:load anymore because I want my client to enter
data and preserve it between manual tests, and the fixture system
wipes every named table. So I just dumped the database and trimmed it
down to an ugly stack of SQL INSERT statements.
Oh, and my automated tests have the option to hit those buttons, too…
Phlip(anyone) - I was thinking of using also a test button coupled with
a
test action for the purpose of emulating the response from paypal. I
was
pondering how to ensure both the button & action could only be got at in
development mode (and perhaps test)?
Would a check “if RAILS_ENV == “development” then …” used in the view
and
controller action be secure enough to prevent someone breaking into this
test code?
Phlip(anyone) - I was thinking of using also a test button coupled with a
test action for the purpose of emulating the response from paypal. I was
pondering how to ensure both the button & action could only be got at in
development mode (and perhaps test)?
Just one more tip:
if RAILS_ENV == “development”
def magic_disappearing_action
naughty_methods_here
end
end
Yes, you can write raw Ruby inside a class, for conditional
compilation. That’s because Ruby…