Greg Hauptmann
2007-Feb-09 11:32 UTC
test or development environment for ad hoc testing via web interface but with fixtures
Hi, 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? Tks Greg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
monki
2007-Feb-09 18:14 UTC
Re: test or development environment for ad hoc testing via web interface but with fixtures
If you just need to get fixtures into development mode I would just do it from the command line. At the command line, I believe you''ll want: rake db:fixtures:load RAILS_ENV=development Then you will have the data you wanted in development mode and you can go from there. On Feb 9, 5:32 am, "Greg Hauptmann" <greg.hauptmann.r...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > 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? > > Tks > Greg--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip
2007-Feb-09 18:30 UTC
Re: test or development environment for ad hoc testing via web interface but with fixtures
Greg Hauptmann wrote:> 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 http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Hauptmann
2007-Feb-09 20:17 UTC
Re: test or development environment for ad hoc testing via web interface but with fixtures
tks Monki - excellent 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? Tks Greg On 2/10/07, Phlip <phlip2005-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Greg Hauptmann wrote: > > > 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 > http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Phlip
2007-Feb-09 21:19 UTC
Re: test or development environment for ad hoc testing via web interface but with fixtures
Greg Hauptmann wrote:> 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... ----> doesn''t give a shit <---- ...but in a good way. ;-) -- Phlip http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---