search for: fixturereplac

Displaying 14 results from an estimated 14 matches for "fixturereplac".

2008 Sep 09
8
Cucumber and fixtures/FixtureReplacement
...Stories before, so I decided to follow the apparent direction of the wind and just jump right into cucumber. I''m dabbling with/using Cucumber and really like it. Good job, aslak! Where i''m struggling right now is using either fixtures or a model factory methodology like the FixtureReplacement. In both cases, I''m not seeing anything getting loaded into the database. I have some legacy fixtures that I''m willing to let go of, but I kind of assumed that they would work for now. When I run my Features, I''m not seeing anything whatsoever loaded into the...
2007 Nov 20
9
Testing Models without fixtures
Hi, I would like to test a sorting method that is in the user model, it''s a class method called search. What I would like to do is create 2 users and load the test database with just those 2 users, so that I can call User.search("john") and it would return those two users. Not sure how to clear the test database and populate it just with these 2 users for that specific
2007 Oct 16
12
Example for attr_accessible?
Is anyone out there writing specs to check attr_accessible fields? I had originally written my spec to check for allowing the desired fields, and then none of the other regular db fields. Unfortunately this isn''t satisfactory, because attr_protected could have been used instead, which of course wouldn''t prevent mass assignment to any whatever=(val) method. I''m thinking
2008 Jan 11
5
Missing methods
We have a custom implementation of the Mother Object idea. It''s inside of a module, basically like this: module Factory %w(account friendship person invitation message asset email_address birth).each do |klass| eval <<-EOF def self.create_#{klass}(attributes = {}) default_attributes = valid_#{klass}_attributes #{klass.camelize}.create!
2007 Dec 21
4
StoryRunner docs/guidance
Hi all, Are there any plans for better documentation for the new StoryRunner feature? I tried to use it today (with Rails), and had a hard time getting my head around whether I was doing it "right" and exactly what things are appropriate to test at that level (this might be exacerbated by the fact that I''ve never really used integration testing that much). A full example of
2008 May 27
1
Testing rails plugins standalone
I''d like to finally get started with RSpec, however, not on a complete (rails or whatever) application, but only on a single rails plugin. In particular, I want to test the plugin without the context of a specific rails app. The only parts of rails that I need are ActiveRecord and ActiveSupport. It would be very helpful to have an existing plugin that''s tested like this as
2007 Oct 16
10
Scenarios Plugin Pre-Announcement
This is sort of a pre-announcement for a Rails plugin my friend Adam Williams and I are working on. We''re in the process of extracting it from a project we are working on so that it can be generally useful to the Rails community. We are calling it "Scenarios". It is a drop in replacement for Rails fixtures: http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README
2008 Jun 07
2
rcov causing a segmentation fault on rspec 1.1.4 and rails 2.1
Hello again :) I''m trying to run rcov on my specs here but i''m getting a lot of segmentation faults (and they usually happen at different places): /home/mauricio/NetBeansProjects/reeds/vendor/rails/activerecord/lib/active_record/attribute_methods.rb:211: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i486-linux]
2007 Oct 25
6
Rollbacks, Sqlite3 bug
Okay - so the sqlite bug reported a day or so ago on the list is real bug. I''m going to file something in the tracker for that... I also learned that before(:all)...after(:all) is not wrapped in a transaction, the way before(:each)...after(:each) is. Is there some reason behind this? Can you not wrap transactions inside transactions? Scott
2007 Oct 29
7
rake spec default environment
hi, When I run rake spec , it seems to be starting with my default environment (development or production) and connects to that database, before actually connecting to the test one and proceeding with the tests. When I remove the development database, the specs wont run. How do i initiate rspec to be test environment from the start? I dont see this when i run using script/spec linoj
2008 Jan 23
6
sharing specs in a subclass
Hi I''ve spec''d a class and they pass. Now I''d like to assure that any subclass of this class also passes the same specs. Any suggestions for a clever way to handle this? I''d prefer to keep the existing specs as is (eg instead of moving everything into shared behaviors, or doing something to all the ''describe'' lines) thanks linoj
2008 Jan 11
13
Role of stories vs specs, revisited
A couple months ago I asked how stories and specs might impact each other. [1] If you look at Dan North''s example of what''s in a story [2], and you imagine using the spec framework to drive the design, you can probably imagine a significant bit of overlap in the two. Is that a bad thing? I''m not sure. It has made me a bit uncomfortable though, and I''ve
2008 Dec 16
20
step definitons to check login
I am working with the authlogic gem and trying to create a simple login test from cucumber features. The feature statement is: Given the user is not logged in The step definition for this is confounding me. In the application_controller the authlogic tutorial recommends the following: private def require_user unless current_user store_location flash[:notice] =
2007 Dec 06
43
Mocks? Really?
OK, so i''ve played a bit with mocks and mock_models in controller and view tests and i have a question. Is this statement really correct: "We highly recommend that you exploit the mock framework here rather than providing real model objects in order to keep the view specs isolated from changes to your models." (http://rspec.rubyforge.org/documentation/rails/writing/views.html