Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Zach Dennis
I know the problem has been solved but you can supply global fixtures in your spec_helper.rb file. This avoids having to repeat them for every describe block. Spec::Runner.configure do |config| config.global_fixtures = :table_a, :table_b end Zach On Wed, May 21, 2008 at 10:49 PM, Andrew Selde

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread David Chelimsky
On May 22, 2008, at 10:19 AM, Andrew Selder wrote: YEAH!!! I've got it. I changed my rspec.rake to: spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? ["db:test:purge", :testing, "db:migrate"] : :noop task :noop do end task :testing => :environment do RAILS_

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Andrew Selder
YEAH!!! I've got it. I changed my rspec.rake to: spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? ["db:test:purge", :testing, "db:migrate"] : :noop task :noop do end task :testing => :environment do RAILS_ENV = ENV['RAILS_ENV'] = 'test' ActiveRecord::Base.

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Andrew Selder
I tried modifying rspec.rake to read spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? [:testing, "db:test:purge", "db:migrate"] : :noop task :noop do end task :testing do RAILS_ENV = ENV['RAILS_ENV'] = 'test' end which should do what I want, I think. However the

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Ashley Moran
On 22 May 2008, at 15:25, David Chelimsky wrote: Sounds like the solution would be something like what Scott and Ashley are talking about - introducing rake db:migrate or a custom data setup task after or instead of db:test:prepare. It just occurred to me that I never ran any rake tasks to ru

Re: [rspec-users] Story / Redirection to static html within public

2008-05-22 Thread Josh Knowles
On 5/22/08, Joseph Wilk <[EMAIL PROTECTED]> wrote: > With a rails application I'm trying to access the public/ folder from > within a rspec story. > > I have a controller which redirects to: > > /public/static_html_page.html I assume you mean /static_html_page.html? Your document_root in your

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread David Chelimsky
On Thu, May 22, 2008 at 9:12 AM, Andrew Selder <[EMAIL PROTECTED]> wrote: > Downloaded the latest plugins from Github and got the same results. > > The spec rake task still ends up calling db:test:prepare which blows away > the database and reloads only the schema. Well, thanks for trying. You ca

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Pat Maddox
Have you tried making it not call db:test:prepare? On Thu, May 22, 2008 at 7:12 AM, Andrew Selder <[EMAIL PROTECTED]> wrote: > Downloaded the latest plugins from Github and got the same results. > > The spec rake task still ends up calling db:test:prepare which blows away > the database and reload

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Andrew Selder
Downloaded the latest plugins from Github and got the same results. The spec rake task still ends up calling db:test:prepare which blows away the database and reloads only the schema. Thanks, Andrew On May 22, 2008, at 9:58 AM, David Chelimsky wrote: On Thu, May 22, 2008 at 8:55 AM, Andrew

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread David Chelimsky
On Thu, May 22, 2008 at 8:55 AM, Andrew Selder <[EMAIL PROTECTED]> wrote: > David, > > The static data generated in the migrations in being wiped away. > > I did a > rake db:test:purge > > followed by > > rake db:migrate RAILS_ENV=test > > and then looked in my database to verify that the data was

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Andrew Selder
David, The static data generated in the migrations in being wiped away. I did a rake db:test:purge followed by rake db:migrate RAILS_ENV=test and then looked in my database to verify that the data was there and it was. And then when I run rake spec, the test blow up and I looks at the DB

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread David Chelimsky
On May 21, 2008, at 9:49 PM, Andrew Selder wrote: Is it possible to specify that certain tables not be cleared on each example. I've inherited a project where a good amount of enumerated data is stored in the database (US States, statuses, about 15-20 tables worth. Over all, it's a reason

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Andrew Selder
Ashley, I am using rake db:migrate RAILS_ENV=test. The values I'm inserting into the tables using migrations are gone by the time the tests run. Andrew On May 22, 2008, at 7:07 AM, Ashley Moran wrote: On 22 May 2008, at 03:49, Andrew Selder wrote: It would be wonderful if there was some

[rspec-users] Story / Redirection to static html within public

2008-05-22 Thread Joseph Wilk
With a rails application I'm trying to access the public/ folder from within a rspec story. I have a controller which redirects to: /public/static_html_page.html I have a story written using webat. This story uses the above controller and it expects the redirection. This story always fails as w

Re: [rspec-users] Specifying certain tables NOT to be cleared each example?

2008-05-22 Thread Ashley Moran
On 22 May 2008, at 03:49, Andrew Selder wrote: It would be wonderful if there was some option to specify tables that behave like this, that should be loaded at the beginning of the test run, and (optionally) trashed at the end of the run. Or even better, specify that the test script should

Re: [rspec-users] Testing REST webservices? (Not Rails)

2008-05-22 Thread Ashley Moran
On 21 May 2008, at 21:37, Erik Terpstra wrote: I am new to RSpec and BDD. I was wondering if RSpec specifications are a good solution for testing REST webservices (not implemented in Rails). If so, what would be a good way to test something like the API described below? Hi Erik RSpec wou