I''m writing a simple app that doesn''t need to use a database. I added :active_record to the config.frameworks -= line in environment.rb file. This lets me run ./script/generate fine without complaining about no connection. However if I try to run a functional test, it complains about no connection being established. Well...I don''t want a connection to be established. I''ve tried overriding Fixtures#teardown to be blank, but that doesn''t do anything. The actual error is: 1) Error: test_get_convert(HhconvControllerTest): ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in `connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in `teardown_with_fixtures'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in `teardown'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in `teardown'' I put this in my test_helper.rb file: class Fixtures def teardown() end end No luck though. I''d like to be able to run unit tests on my models and functional tests on my controllers. I don''t see why it needs a database to do that. Can anyone offer me any pointers? Thanks, Pat
Perhaps not exactly the answer you''re looking for, but what I did in a similar case (my Rails app was hitting web services for data) is to use sqlite memory db for testing. Keep in mind you need to have sqlite installed. test: adapter: sqlite3 database: ":memory:" Hope it helps, Obie On 12/21/05, Pat Maddox <pergesu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m writing a simple app that doesn''t need to use a database. I added > :active_record to the config.frameworks -= line in environment.rb > file. This lets me run ./script/generate fine without complaining > about no connection. However if I try to run a functional test, it > complains about no connection being established. Well...I don''t want > a connection to be established. I''ve tried overriding > Fixtures#teardown to be blank, but that doesn''t do anything. The > actual error is: > 1) Error: > test_get_convert(HhconvControllerTest): > ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in > `retrieve_connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in > `connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in > `teardown_with_fixtures'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in > `teardown'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in > `teardown'' > > > I put this in my test_helper.rb file: > class Fixtures > def teardown() end > end > > No luck though. I''d like to be able to run unit tests on my models > and functional tests on my controllers. I don''t see why it needs a > database to do that. Can anyone offer me any pointers? > > Thanks, > Pat > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Well I got something figure out finally...haven''t been working on it this whole time, but I decided to give it another go tonight. You can check it out on my blog: http://www.flpr.org/articles/2006/01/24/database-less-testing If anyone can tell me how to make resources show up in the browser instead of prompt a download dialog, I''d really appreciate it :) I''ve tried setting the content type to text/plain, but no luck apparently. Anyway, hope someone finds this useful. Pat On 12/21/05, Pat Maddox <pergesu@gmail.com> wrote:> I''m writing a simple app that doesn''t need to use a database. I added > :active_record to the config.frameworks -= line in environment.rb > file. This lets me run ./script/generate fine without complaining > about no connection. However if I try to run a functional test, it > complains about no connection being established. Well...I don''t want > a connection to be established. I''ve tried overriding > Fixtures#teardown to be blank, but that doesn''t do anything. The > actual error is: > 1) Error: > test_get_convert(HhconvControllerTest): > ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in > `retrieve_connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in > `connection'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in > `teardown_with_fixtures'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in > `teardown'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in > `teardown'' > > > I put this in my test_helper.rb file: > class Fixtures > def teardown() end > end > > No luck though. I''d like to be able to run unit tests on my models > and functional tests on my controllers. I don''t see why it needs a > database to do that. Can anyone offer me any pointers? > > Thanks, > Pat >
Hey Obie, I spent some more time on this tonight and think I may have found a solution. Thought you might be interested: http://www.flpr.org/articles/2006/01/24/database-less-testing Pat On 12/22/05, Obie Fernandez <obiefernandez@gmail.com> wrote:> Perhaps not exactly the answer you''re looking for, but what I did in a > similar case (my Rails app was hitting web services for data) is to > use sqlite memory db for testing. Keep in mind you need to have sqlite > installed. > > test: > adapter: sqlite3 > database: ":memory:" > > Hope it helps, > Obie > > On 12/21/05, Pat Maddox <pergesu@gmail.com> wrote: > > I''m writing a simple app that doesn''t need to use a database. I added > > :active_record to the config.frameworks -= line in environment.rb > > file. This lets me run ./script/generate fine without complaining > > about no connection. However if I try to run a functional test, it > > complains about no connection being established. Well...I don''t want > > a connection to be established. I''ve tried overriding > > Fixtures#teardown to be blank, but that doesn''t do anything. The > > actual error is: > > 1) Error: > > test_get_convert(HhconvControllerTest): > > ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in > > `retrieve_connection'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in > > `connection'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in > > `teardown_with_fixtures'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in > > `teardown'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in > > `teardown'' > > > > > > I put this in my test_helper.rb file: > > class Fixtures > > def teardown() end > > end > > > > No luck though. I''d like to be able to run unit tests on my models > > and functional tests on my controllers. I don''t see why it needs a > > database to do that. Can anyone offer me any pointers? > > > > Thanks, > > Pat > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
What did you use to format the Ruby source code you posted with color highlighting? Curt On 1/24/06, Pat Maddox <pergesu@gmail.com> wrote:> Hey Obie, > > I spent some more time on this tonight and think I may have found a > solution. Thought you might be interested: > http://www.flpr.org/articles/2006/01/24/database-less-testing > > Pat > > > On 12/22/05, Obie Fernandez <obiefernandez@gmail.com> wrote: > > Perhaps not exactly the answer you''re looking for, but what I did in a > > similar case (my Rails app was hitting web services for data) is to > > use sqlite memory db for testing. Keep in mind you need to have sqlite > > installed. > > > > test: > > adapter: sqlite3 > > database: ":memory:" > > > > Hope it helps, > > Obie > > > > On 12/21/05, Pat Maddox <pergesu@gmail.com> wrote: > > > I''m writing a simple app that doesn''t need to use a database. I added > > > :active_record to the config.frameworks -= line in environment.rb > > > file. This lets me run ./script/generate fine without complaining > > > about no connection. However if I try to run a functional test, it > > > complains about no connection being established. Well...I don''t want > > > a connection to be established. I''ve tried overriding > > > Fixtures#teardown to be blank, but that doesn''t do anything. The > > > actual error is: > > > 1) Error: > > > test_get_convert(HhconvControllerTest): > > > ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in > > > `retrieve_connection'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in > > > `connection'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in > > > `teardown_with_fixtures'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in > > > `teardown'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in > > > `teardown'' > > > > > > > > > I put this in my test_helper.rb file: > > > class Fixtures > > > def teardown() end > > > end > > > > > > No luck though. I''d like to be able to run unit tests on my models > > > and functional tests on my controllers. I don''t see why it needs a > > > database to do that. Can anyone offer me any pointers? > > > > > > Thanks, > > > Pat > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
<typo:code lang="ruby"> cool ruby code here </typo:code> On 1/24/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:> What did you use to format the Ruby source code you posted with color > highlighting? > > Curt > > On 1/24/06, Pat Maddox <pergesu@gmail.com> wrote: > > Hey Obie, > > > > I spent some more time on this tonight and think I may have found a > > solution. Thought you might be interested: > > http://www.flpr.org/articles/2006/01/24/database-less-testing > > > > Pat > > > > > > On 12/22/05, Obie Fernandez <obiefernandez@gmail.com> wrote: > > > Perhaps not exactly the answer you''re looking for, but what I did in a > > > similar case (my Rails app was hitting web services for data) is to > > > use sqlite memory db for testing. Keep in mind you need to have sqlite > > > installed. > > > > > > test: > > > adapter: sqlite3 > > > database: ":memory:" > > > > > > Hope it helps, > > > Obie > > > > > > On 12/21/05, Pat Maddox <pergesu@gmail.com> wrote: > > > > I''m writing a simple app that doesn''t need to use a database. I added > > > > :active_record to the config.frameworks -= line in environment.rb > > > > file. This lets me run ./script/generate fine without complaining > > > > about no connection. However if I try to run a functional test, it > > > > complains about no connection being established. Well...I don''t want > > > > a connection to be established. I''ve tried overriding > > > > Fixtures#teardown to be blank, but that doesn''t do anything. The > > > > actual error is: > > > > 1) Error: > > > > test_get_convert(HhconvControllerTest): > > > > ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in > > > > `retrieve_connection'' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in > > > > `connection'' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in > > > > `teardown_with_fixtures'' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in > > > > `teardown'' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in > > > > `teardown'' > > > > > > > > > > > > I put this in my test_helper.rb file: > > > > class Fixtures > > > > def teardown() end > > > > end > > > > > > > > No luck though. I''d like to be able to run unit tests on my models > > > > and functional tests on my controllers. I don''t see why it needs a > > > > database to do that. Can anyone offer me any pointers? > > > > > > > > Thanks, > > > > Pat > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Cool... you''re running a newer version of typo than I am. I gotta get myself upgraded! Curt On 1/24/06, Pat Maddox <pergesu@gmail.com> wrote:> <typo:code lang="ruby"> > cool ruby code here > </typo:code> > > On 1/24/06, Curt Hibbs <ml.chibbs@gmail.com> wrote: > > What did you use to format the Ruby source code you posted with color > > highlighting? > > > > Curt > > > > On 1/24/06, Pat Maddox <pergesu@gmail.com> wrote: > > > Hey Obie, > > > > > > I spent some more time on this tonight and think I may have found a > > > solution. Thought you might be interested: > > > http://www.flpr.org/articles/2006/01/24/database-less-testing > > > > > > Pat > > > > > > > > > On 12/22/05, Obie Fernandez <obiefernandez@gmail.com> wrote: > > > > Perhaps not exactly the answer you''re looking for, but what I did in a > > > > similar case (my Rails app was hitting web services for data) is to > > > > use sqlite memory db for testing. Keep in mind you need to have sqlite > > > > installed. > > > > > > > > test: > > > > adapter: sqlite3 > > > > database: ":memory:" > > > > > > > > Hope it helps, > > > > Obie > > > > > > > > On 12/21/05, Pat Maddox <pergesu@gmail.com> wrote: > > > > > I''m writing a simple app that doesn''t need to use a database. I added > > > > > :active_record to the config.frameworks -= line in environment.rb > > > > > file. This lets me run ./script/generate fine without complaining > > > > > about no connection. However if I try to run a functional test, it > > > > > complains about no connection being established. Well...I don''t want > > > > > a connection to be established. I''ve tried overriding > > > > > Fixtures#teardown to be blank, but that doesn''t do anything. The > > > > > actual error is: > > > > > 1) Error: > > > > > test_get_convert(HhconvControllerTest): > > > > > ActiveRecord::ConnectionNotEstablished: ActiveRecord::ConnectionNotEstablished > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:111:in > > > > > `retrieve_connection'' > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in > > > > > `connection'' > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:508:in > > > > > `teardown_with_fixtures'' > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:531:in > > > > > `teardown'' > > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/fixtures.rb:529:in > > > > > `teardown'' > > > > > > > > > > > > > > > I put this in my test_helper.rb file: > > > > > class Fixtures > > > > > def teardown() end > > > > > end > > > > > > > > > > No luck though. I''d like to be able to run unit tests on my models > > > > > and functional tests on my controllers. I don''t see why it needs a > > > > > database to do that. Can anyone offer me any pointers? > > > > > > > > > > Thanks, > > > > > Pat > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Apparently Analagous Threads
- App running fine on Webrick, ActiveRecord::ConnectionNotEstablished in lighttpd
- rake test_units not loading any fixtures
- Rails scaffolding - cannot get access to MySQL
- Anyone know whats going on with PostgreSQL async_exec errors?
- Oracle 10g Express - generate scaffold gives error