similar to: Verifying some understanding about manipulating DB data in before/after callbacks in RSpec

Displaying 20 results from an estimated 400 matches similar to: "Verifying some understanding about manipulating DB data in before/after callbacks in RSpec"

2009 Feb 06
6
RecordNotFound bubbling thru to cucumber
Hello, I have a controller action that raises a RecordNotFound exception if you''re not allowed to see something. In my global application controller (application.rb), I catch these and render the 404 template. But when I run cucumber (using webrat), it''s getting the full stacktrace (the step blows up). Any ideas why? I have consider_all_requests_local turned off in my test.rb.
2009 Sep 22
4
rspec-rails and rack middleware
It doesn''t seem like my controller specs are calling my middleware on requests. Has anyone figured out a good way to test middlware with rspec? I''m thinking something like rails'' rails/actionpack/test/controller/session/mem_cache_store_test.rb but with rspec... any thoughts? Thanks! Best, Aaron -------------- next part -------------- An HTML attachment was scrubbed...
2007 Aug 31
3
Setting use_transactional_fixtures=false for a single spec - a bad idea?
Hi! I would really like to find a way to allow me to write RSpec specifications for code that use database transactions. I know I can set config.use_transactional_fixtures = false in my spec_helper.rb. That works, and that''s great, but it will (I think) slow down my specs quite a bit. I would like to turn off transactional fixtures for just a single spec (describe), or even
2009 Oct 06
3
rspec-rails 1.2.9 Released
rspec-rails version 1.2.9 has been released! * <http://rspec.info> * <http://rubyforge.org/projects/rspec> * <http://github.com/dchelimsky/rspec-rails> * <http://wiki.github.com/dchelimsky/rspec/rails> * <rspec-devel at rubyforge.org> Behaviour Driven Development for Ruby on Rails. Changes: ### Version 1.2.9 / 2009-10-05 * enhancements * added route_to and
2006 Nov 04
0
use_transactional_fixtures= and Test::Rails
With a normal test_helper, everything works just fine. However, if I change test_helper.rb to include test/rails and the class from Test::Unit::TestCase to Test::Rails::TestCase, I get this: ./test/functional/../test_helper.rb:19: undefined method `use_transactional_fixtures='' for Test::Rails::TestCase:Class (NoMethodError) from ./test/functional/contact_controller_test.rb:1
2006 Jun 28
2
undefined method `use_transactional_fixtures=''
Folks, I checked my test_helper.rb and it has self.use_transactional_fixtures = true My code was generated with 1.1.2 and I''m using 1.1.3 right now after but the error persists. I googled for this issue and it appears that a require is missing or something like that. I can''t figure it out, please help! /opt/local/bin/ruby -Ilib:test
2007 Oct 08
3
test not rolling back
For testing, I use: self.use_transactional_fixtures = true This should cause a ROLLBACK for each test case. If I run a single file, foo_controller_test.rb, it works as expected. I see BEGIN and ROLLBACK 8 times in the log files. But if I run: rake test:functionals I get 3 COMMITs, 196 BEGINS and 193 ROLLBACKs. The code in fixtures.rb that deals with this is : def
2006 Jun 12
2
Database in RoR application
I''m working on a new rails project that will have a very, very large database. Initial insert will be in the hundreds of thousands of records. The database we are getting the information from is Microsoft SQL based, and we have access to tab delimited update files daily. We''re trying to write import scripts and use a well designed database on our end. The data they are
2007 Jan 10
1
Solution for undefined method `use_transactional_fixtures=' ... problem
If you see this error message: undefined method `use_transactional_fixtures='' for Test::Unit::TestCase:Class (NoMethodError) You should check all your dependencies, all the lines containing require and especially require_dependency. You have probably done a refactoring "Rename" a class and forgot to propagate the change everywhere! More details on
2009 Sep 30
10
Can't run specs after upgrading gems... get 0 tests, 0 assertions...
So after I updated all my gems, I started getting: /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/ dependencies.rb:105:in `const_missing'': uninitialized constant Test::Unit::TestResult::TestResultFailureSupport (NameError) from /Library/Ruby/Gems/1.8/gems/test-unit-2.0.3/lib/test/unit/ testresult.rb:28 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
2009 Sep 20
11
describe block proc parameter as alternative to before blocks?
I''ve been reading through the Rspec book to see if I missed any tricks, and the discussion of before block use for context setup in sec 12.6 struck me as interesting and something I had a knee-jerk reaction to. I think that when you are using nested examples to describe a context change it is bad practice to allow any example within that group to run outside of that context. This could
2008 Mar 14
2
Lib Specs and config.use_transactional_fixtures = true
Hi We have specs in our rails project other than model/view/controller .. we have interests and lib ... using use_transactional_fixtures = true seems fine in a spec in the m/ v/c and interests directories but not in lib Just wondered if anyone had any quick thoughts as to why that may be??? Shane Mingins ELC Technologies (TM) 1921 State Street Santa Barbara, CA 93101 Phone: +64 4 568
2011 Jan 14
4
Rails 3 / RSpec 2 use_transactional_fixtures and after_commit
We''re migrating a Rails 2.3.x application to Rails 3 and RSpec 2.x. In Rails 2.3.x we were using https://github.com/freelancing-god/after_commit to provide after_commit functionality (now provided by Rails 3). The plugin version of after_commit came with some helpers to make testing with `use_transactional_fixtures = true` work. From: https://github.com/freelancing-god/after_commit
2009 Oct 14
14
spec-ing private methods?
On Wed, Oct 14, 2009 at 5:49 PM, Scott Taylor <scott at railsnewbie.com> wrote: > > On Oct 14, 2009, at 3:36 PM, Joaquin Rivera Padron wrote: > > hello there, > how do you tipically spec private methods? The thing is ? have something > like this: > > def some_method > ?? complex_method + other_complex_methods > end > > private > def complex_method...
2011 Aug 10
1
How to stop Rspec loading my Cucumber fixtures
I have a bunch of fixtures designed to populate the database for my Cucumber integration tests. But at this stage I want my database to be empty when using Rspec. So, I moved the fixtures from `/spec/fixtures` to `features/support/fixtures`, and updated `features/support/env.rb` to read: Fixtures.reset_cache fixtures_folder = File.join(RAILS_ROOT, ''features'',
2006 Apr 16
7
Problem running unit tests
I am running Rails 1.1.2 with Ruby 1.82-15. My database is Postgresql. I haven''t had any problems generating models, migrations, using scaffolds, and generally building and using my application, but I haven''t been able to get testing to work. I initially just ignored the problem and kept developing, but would like to add proper testing from here on out. Currently when I type
2006 Jun 11
4
Model records are not saved to database in during tests
Hi, I''m trying to do unit tests which should save informations into a database that another computer should be able to get while the test is running. The problem is although my unit test class has "use_transactional_fixtures" set to false, when I create a new instance of a model and save it, it does not actually appear in the database when connecting to this same
2008 Feb 12
4
Funny behavior with Fixtures... on Ubuntu..
Hey Guys, I''ve got a test class that loads a bunch of fixtures. My understanding is that fixtures are reloaded between each test... and I even have the following two method calls at the top of my test class to make doubly sure... class TaskTest < Test::Unit::TestCase self.use_transactional_fixtures = true self.use_instantiated_fixtures = false When I run my tests
2008 Aug 11
1
Confused about square bracket usage.
I ran script/generate rspec_scaffold page title:string body:text and have been reading on the generated code in my spare time in an attempt to fully understand rspec. It mostly makes a lot of sense except for the square brackets in the snippet below. To my best understanding, [mock_page] would be an array containing mock_page. That almost makes sense, buy why wouldn''t the variable
2008 Aug 05
1
Rails controller specs and private helper methods
Hello guys, Been a while since last time I worked with Rails so is taking me a while get back to full speed. For a specific scenario I''m facing right now, I required to implement a generic REST controller that accept any kind of resource and provide a @collection or @record to work with. I take from the route requirements the name of the resource