Displaying 20 results from an estimated 10000 matches similar to: "Fixtures, Postgres & Constraints"
2006 Mar 21
8
Redirect without port number?
On my host I run my lighttpd instance bound to a specific port and my
hostname is mapped to this port (I''m not exactly sure how this is
accomplished, but it is lighttpd also listening on port 80 which handles
this for me I believe).
A redirect from rails includes my local port number in the request, so that
it shows up in the address bar. I prefer people not to see this - I
2007 Aug 27
7
Foreign key constraints, fixtures, and rake task
I''ve got a spec that loads a fixture in the "before" block. This works
fine running scripts/spec, but when I run rake spec instead, I get:
ActiveRecord::StatementInvalid in ''User in fixture :quentin with an IM
service but no IM name should be invalid''
Mysql::Error: Cannot delete or update a parent row: a foreign key
constraint fails
2006 Apr 01
3
Syncpeople Plugin Scope Never Active
I installed the Syncpeople textmate bundle (
http://syncpeople.com/downloads/syncpeople_on_rails_features ) and the
commands all work from the menu, but the short-cuts never work for any
of the snippets or commands ever work, because the scopes are not
being selected properly. If I change the scope to just "source.ruby"
it will work fine. But I cannot see why their scope selectors do not
2006 Mar 20
8
Best way to organize non-controller logic???
I don''t want to put certain code in my controller because I think it
makes things more confusing.
What is the best way to manage business logic such that it doesn''t end
up in the controller?
Basically, where should I put my regular utility classes and backing
objects that may not be models?
Thanks,
Wes
--
Posted via http://www.ruby-forum.com/.
2006 Mar 21
8
AS/400?
Any success stories using rails against a DB2 database on an as400?
If so, how?
Thanks
Ed Schechter
--
Posted via http://www.ruby-forum.com/.
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 May 09
2
load fixtures
I''m finally getting beyond using basic test fixtures, and a few questions
have popped up. Has anyone found ways to do these?
1. Use a test fixture that is named differently from its table name? We''d like
to have more than one possible fixture per table. (Or perhaps use test fixtures
named similarly but in different directories.)
2. Load a test fixture for one test method only
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
2007 Sep 07
4
fixtures in before(:all)
I was planning on using a fixture within a description that didn''t modify
the fixture, so I put it in a before(:all) block:
describe "Customer", "xml" do
fixtures :customers
before(:all) do
one = customers(:one)
end
# ...
As a result, I got this message:
1)
NoMethodError in ''Customer xml before(:all)''
You have a nil object when you
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
2006 May 23
2
Putting fixtures into subdirectories
I want to organize my fixtures just like the namespace of my models. So
for example if I have a model Company::Employee I''d like the fixture to
be in fixtures/company/employees.yml.
However, I can''t figure out how to specify the path of the fixture file.
If I do:
fixtures :employees
in my unit test it can''t find the fixture file. Any suggestions?
Thanks,
Todd
2007 Dec 01
10
Fixtures Cleanup
All,
I''ve been playing a bit with some patches to make the fixture loading
and management code a little bit easier to maintain. If I were to
start chopping out features, how would you feel about losing:
Fixture instantiation,
Old school single-file fixtures,
CSV fixtures,
The ability to specify a subset of fixtures (everything''s always
loaded instead),
The ability to
2006 Aug 03
2
Including ALL fixtures for a test
I am running into some issues with my functional tests because they need
info from almost every single table in the database. I have long
laundry lists of fixture names to include on these test files and then I
have to troubleshooot bizarre test failures because of a fixture that
was not included.
So is there a way to simply include all fixtures in a test? Something
like:
fixtures :all
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
2007 Jun 27
5
Mosquito Fixtures Won''t Load
I can''t get fixtures to load correctly in a Mosquito test. The first
fixture loads in the unit test, but the rest don''t load at all.
File structure:
tracker/
tracker.rb
test/
test_tracker.rb
fixtures/
tracker_measurements.yml
tracker_projects.yml
Relevant test code:
require ''rubygems''
2005 Mar 03
4
Loading data with fixtures
Can anyone point me to an easy way to load fixture
data into the development (not test) database?
- Tim
__________________________________
Celebrate Yahoo!''s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/
2007 May 18
3
Fixtures considered harmful?
I''m trying to get really serious about doing true BDD for a new Rails
project, and I note that at <http://rspec.rubyforge.org/documentation/
rails/index.html> it says:
"we really don?t recommend the use of rails fixtures"
On the same page it also says (about Model specs):
"these are the only specs that we feel should actually interact with
the database"
2005 Dec 15
3
Fixtures and table name
Is there a way to use table name other than the default or to turn it around have multiple fixture files associated to the same table.
Here''s my use case: I have multiple unit test classes that all work with the same model class and hence the same database table. However, for each test class I want the data to be in a different state.
So I''d like to have something like
class
2005 Oct 27
2
Fixtures are not loading into instance variables. Why not?
Hi,
I have a fixture in a unit test and I see that the
fixture is loaded correctly into the database table,
but no instance variables are created.
So now I''m stuck.
More background: this is my first RoR project and I
have just installed the SaltedLoginGenerator and
generated its output.
Running the unit tests gives an error, so I cut it
down to just 1 test:
2007 May 21
2
Rails'' fixtures suck! But what about something like this?
Sorry about the very long email, but this is a hairy topic that''s been
annoying me for some time and I decided to try to do something about.
Also, if you got this twice, I apologize too, but it didn''t seem to
have successfully gone out the first time.
Background:
----------
I''ve been dealing with Rails for about a year and a half now. I''ve
been using