similar to: Dump plugin models to fixtures?

Displaying 20 results from an estimated 60000 matches similar to: "Dump plugin models to fixtures?"

2008 Feb 11
6
Should I Test My Fixtures?
I have a number of fixtures in my test suite. For example, with acts_as_authenticated and acts_as_state_machine, I created a number of users in different account states for use in functional testing. (Suspended users can not log in, etc) Is it a good idea to run fixtures through tests to ensure that they conform to their ideals? EG: assert users(:suspended_user).suspended? If so, where should
2010 May 26
3
Plugin test fixtures
Just spent a good bit of time trying to figure out why I couldn''t get fixtures to work in a plugin test. I was including ActiveRecord::TestFixtures into ActiveSupport::TestCase and trying to get fixtures to automatically reload for every test like regular Rails tests. The problem was in the first line of ActiveRecord::TestFixtures.setup_fixtures: return unless defined?(ActiveRecord)
2006 Jul 26
1
fixtures not loading when running rake test - ok other times
Hallo -- I have the most bizzare problem. I have a test called PropertyTest that runs absolutely fine. Even if I totally clear the test database before running it, it happily scoots off, loads all necessary fixtures, runs & passes all tests. My problem arises when I run rake test:units. Then, all other tests pass fine, but this one starts failing as if the fixture data simply
2007 Dec 18
3
MySQL transactions not working in unit tests?
I just installed acts_as_authenticated into an app and one of its unit tests is failing. The cause is that another unit test''s changes to the AAA fixtures aren''t being rolled back. I''m confused, since I have transactional fixtures turned on and MySQL InnoDB engine being used. Details: - MySQL 5.0.24. InnoDB is the default engine, all tables in the test db are using the
2005 Dec 14
3
Plugin w/ Migrations and/or Fixtures?
I''m working on a plugin which needs to add both schema and data to the app database, and I''m trying to figure out the best way to do it. I''d like to use a db migration to modify the schema and load the data from a YAML fixture, but Rails doesn''t seem to support migrations for plugins. To do so, the schema_info table would need to change to include a
2006 Aug 04
1
All Fixtures plugin
Just released a very simple plugin for including all fixtures in your tests. Once you have a large number of table, manually managing the fixtures for every single test stub can be quite tedious. Use as follows class BlogArticleTest < Test::Unit::TestCase all_fixtures def test_foo ... end end Couldn''t be easier. More info here:
2006 Mar 30
3
Export Fixtures Plugin
= Description This plugin is a super lightweight tool used to export data into the test/fixtures directory. So if you want to export all your data from your production server into your development environment, this will simplify the process without having to load up your database manager. [%] rake db:fixtures:export_all RAILS_ENV=development [%] rake db:fixtures:load = INSTALLATION
2005 Dec 30
0
Fixtures for non AR object
I want to unit test some models, but they aren''t AR models. They''re just basic Ruby classes. I''d like to be able to specify them in fixtures files, and run my unit tests normally. The only difference is that they don''t need to be inserted into a database. Is there any way I can do this? Having a heck of a time using Rails WITHOUT a database. Pat
2006 Mar 27
5
Fixtures, Postgres & Constraints
Anyone have any tips for handling postgres constraints when using fixtures to load the database, other than to sort out the proper insertion orders or leaving the constraints out? I''d prefer not to do the former since I''d rather use my app to generate my fixture data (using a dump_fixtures task) and I''d prefer not to do the latter because leaving out constraints till the
2006 Oct 17
3
rake -T is missing rake db:fixtures:dump?
Subject says it all: rake doesn''t know about db:fixtures:dump. When I try, I get this: Don''t know how to build task ''db:fixtures:dump'' I thought this was a standard feature that ships with rake- any idea why it''s missing, and how I can reinstall it? Here''s the environment: Ruby version 1.8.4 (powerpc-darwin8.6.0) RubyGems
2008 Feb 07
4
rspec fixtures stay in the test db - is this right?
I have some fixtures set up to put a few records in some of my tables. In some of my rspec describe blocks, i''m *not* calling the fixtures, and expecting the tables to be empty. But they''re not - the fixture data is in there. Am i using fixtures wrongly? I thought that the db was wiped at the start of every test and the fixtures were only added if asked for. Is that not the
2006 Feb 21
0
acl_system plugin first look
Friends- Here is another plugin hot off the presses of the three day weekend ;) Its a role based authorization system. I have been talking with Bill Katz about this system so it ties in with his recent announcement as well. Its just my implementation. Its an acl/role type system that can sit on top of the acts_as_authenticated login system or any login system that implements a few
2006 May 30
0
data fixtures for non-activerecord models
I have a model that as an instance maintains a session on a website, and has methods to return some scraped data. Instead of hitting a URL over and over during testing, I would like to just save the source to a file and use that like a fixture. A mock object doesn''t seem appropriate, because there is a lot of data here. What I''m doing now is storing each separate
2008 Sep 09
8
Cucumber and fixtures/FixtureReplacement
Hey guys, I''d never used RSpec 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
2006 Mar 20
2
Testing Models And Fixtures
I have finally decided to look into testing and I am going through the examples in the AWDWR book and I tried the following and it does not work... even though I don''t see why it shouldn''t. =========== posts.yml =========== basic_post: id: 1 title: Title body: Body created_at: 2006-02-01 00:00:00 updated_at: 2006_02-02 00:00:00
2008 Nov 05
1
Constants in models are initialized before fixtures are loaded?
Hi, here''s simplified code from the model: class Foo < AR::Base FIRST = Foo.first.id end The problem is that when testing I get well known error: "Called id for nil...". I guess that this constant is initialized before the fixtures are loaded. Is there any way to fix it? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2007 May 27
1
annotate_models plugin to annotate RSpec specs and fixture
I have found useful to have the table information associated to models disp?ayed in the models and fixtures files of my rails applications. If you want to add this information to the spec_fixtures and specs add the following patch to your plugin. Index: vendor/plugins/annotate_models/lib/annotate_models.rb =================================================================== ---
2007 Aug 08
1
Transactional fixtures not working as expected
Hi! I am quite new to BDD and I just wrote my first tests. Suddenly I received unexpected results because in a model test I load only users-fixtures but when the views-fixtures in which I load the posts-fixtures, are run before this model-test, the posts-fixtures are loaded too. I test for example if there is one record in the posts-table after creating one post. But when there are fixtures
2007 Oct 21
13
[ANN/RFC] Rathole, a fixtures extension plugin
Like lots of other folks, I''ve been searching for a way to scratch my fixture itches. Rathole is my extraction of a few techniques we''ve successfully applied at my day job. We''ve been using Rathole for a month or so now, but I''d really like some feedback from a wider audience. Rathole tackles: * Conflicting PK''s (no more id''s in fixture
2009 Mar 28
10
Use fixtures within fixtures?
Heya, I''m using globalize2 and have following problem with my fixtures: categories.yml: one: parent_id: two color: #ff00aa two: color: #00ff11 three: parent_id: two color: #ab00ab category_translations.yml one-en: id: one locale: en name: Cars one-es: id: one locale: es name: Coches two-en: id: two locale: en name: Start two-es: id: two locale: es