Displaying 20 results from an estimated 2000 matches similar to: "Problem: Null values in a CSV format fixture show up a 0 in the test database"
2006 Feb 01
0
Nil in CSV Fixtures
The Guide to Testing the Rails
http://manuals.rubyonrails.com/read/chapter/26#page65
says about CSV fixtures:
nulls can be achived by just placing a comma, for example,
(1,sclaus,,false,) minus the parenthesis of course.
I tried that, but after the fixtures had been created, I checked the
value of the field in the DB and instead of nil the value was zero,
eventhough the default value for the
1997 Jul 17
1
Trouble with permissions on printing to Windows NT printer from SAMBA on Solaris
I have been trying to get SAMBA on a Solaris 2.5 box to print to a
printer on my Windows NT workstation. However, I am having some
problems. I have no problems reading the disk or anything like that -
only printing.
Here is some output:
(1) janus1:~ % smbclient -L hawklord
Added interface ip=10.203.6.100 bcast=10.203.255.255 nmask=255.255.0.0
Server time is Thu Jul 17 10:01:04 1997
Timezone is
2011 Dec 25
1
Fixtures vs Fixture class, what is the intended purpose?
Hello,
i am trying to fix the code for fixtures in rails because it is buggy
and internal variable names are confusing, could somebody please explain
to me what is the intended purpose of Fixture and Fixtures classes
respectively?
For example, why do we need both `Fixtures.initialize`and
`Fixture.initialize`? They both "initialize" a single fixture, and in
fact `Fixture.initialize`
2006 Dec 14
1
create and destroy fixture manually in method
Hi,
My test case has two fixtures and eight methods. But one of the eight
methods need one more fixture. How do I solve this? Okay, I put the
additional fixture in common place so every method has additional access
to the additional fixture. The problem is the additional fixture depend
on that two fixtures (foreign key). When I run the test, it complains
something like this:
2005 Oct 28
2
Accessing fixture
I have a very simple problem. I can''t seem to access
a the fixture by name
I have a sites.yml with:
simple_site:
id: 1
name: demo
description: A demo site
created_on: 2005-10-25 00:00:00
updated_on: 2005-10-25 00:00:00
And I have a test class as:
require File.dirname(__FILE__) + ''/../test_helper''
class SiteTest < Test::Unit::TestCase
fixtures
2006 Jun 13
2
Locating an arbitrary fixture...
Is there a good way to get an arbitrary fixture from the generated
fixture function?
I need a way to get one of my fixtures, I don''t care which one. It
doesn''t need to be random and could always return the same fixture.
This is part of a support function for custom assertions and it doesn''t
know what class its working on, let alone what fixture names are
possible.
2006 Jan 16
2
My first test - named fixture not autoloading instance variable
I''m trying to write a test like the one at the bottom of page 148 in
Agile Rails.
I''m using rails 1.0
I''ve created the fixture correctly I''m pretty sure because the test
database table is being populated per the fixture.
I have what I think is a simple unit test:
=========
require File.dirname(__FILE__) + ''/../test_helper''
class CaseTest
2006 May 09
1
leftover fixture data causing errors
Maybe I''m not getting fixtures, but... I''m having problems as I start using
fixtures in functional tests.
Data is left in my test database after running functional tests. Not the data
created by the test-method (I''m using transactional fixtures), but data from the
fixtures themselves. Fixture loading will delete & reload the data again when
the test is re-run, but
2006 Apr 26
3
Test fixture syntax
OK, I know I''m doing something bone-headed, but I can''t for the life of
me figure it out.
I''ve read the test fixtures Rdoc about eight dozen times, and it says
(to me) that if I have a YAML fixture file, dogs.yml that looks like
this:
fido:
id: 1
breed: Terrier
fifi:
id: 2
breed: Poodle
Then I can include
fixtures :dogs
in my functional test, and
2006 Jan 19
4
hash fixture access broken in functional test
I have a functional test class that uses the "topics" fixture. I
verified that the fixture is loaded into the database by doing this:
assert_equal 2, Topic.find_all.size
So I should have an instance variable called @topics and instance
variables for each of the rows in the fixture, in this case, @first and
@another. But all those variables are nil inside my test method.
Is that
2009 Jul 13
1
Running a single fixture.
Hello. I need to run a single fixture on my server as part of an
update to my application. I noticed that the other tables lost their
data when I run "rake db:fixtures:load". How do I make it so that only
a single fixture runs and ignores the rest?
2006 May 22
1
Agile Web Dev unit test fails with fixture instance variable
I''m following Agile Edition 1. On page 148 it suggests using instance
variables named after the fixture, for example:
assert_equal @version_control_book.id, @product.id
When I introduce this type of instance variable into my test, I get the
following error:
1) Error:
test_not_owner(GroupTest):
RuntimeError: Called id for nil, which would mistakenly be 4 -- if you
really wanted the
2006 Mar 02
1
Fixture accessors broken for polymorphism, in need of redesign
Ticket 4052 (http://dev.rubyonrails.org/ticket/4052) just came through
trac, which introduces the need for a better way to access fixtures. I
believe the basic problem is the same as 3935
(http://dev.rubyonrails.org/ticket/3935) in that the accessor method
which is constructed by the fixture call can''t infer the class name
from the table name. The band-aid in 3935 was to allow you to
2006 Jan 05
1
Fixture files for inserting tree like behavior doesn''t work
Hi folks around, hope you could help me with my problem.
I have a porblem while testing my Acts_as_Tree behavior with fixtures.
Because all data in the fixture file will be commited at the end the
entries I want to map my tree like structure to will not be present at
this point. Due to this I get a foreign key constraints fails from the
database. Is there any way to solve this problem?
Here
2006 Jul 29
1
Anything wrong with this test? Cannot access fixture
Hi,
I have problem accessing the testfixture. The values from the
YML-Fixture-File are correctly written into database, but accessing the
fixture is impossible. It is always nil.
Is anything wrong with this test?
class MyModelTest < Test::Unit::TestCase
fixtures :my_model
def test_simple
a = MyModel.find(@my_model["first"].id) # Accessing @my_model is
impossible
...
2006 Aug 10
0
Load a fixture manually in setup?
I''m running into a problem where one of my fixtures uses ERb to get an
id for a row that isn''t created yet. In setup, I create that row. Since
it appears that fixtures are loaded before setup is run, that''s a
problem.
I can''t put the row creation in a fixture - its part of the business
rules of one of my models.
Anyone know how to load a fixture manually
2006 Nov 04
0
How to reference fixture under folder ?
Hello all,
I have a fixture under folder-grouping :
./fixtures/foo/bars.yml
I need to reference the data in bars during functional test.
methods.sort reveals ''foo/bars'' as a method in the current context
(breakpointed),
but I don''t know how to reference a method called ''foo/bars''.
- OR - how should i reference the fixture when I''m using
2006 Feb 08
0
Fixture access question
Hi,
I want to add the basic model record create tests for my rails app
as in the "Agile Web Development with Rails" example:
i.e. (header stuff and boring repitition missed)
def test_create
assert_kind_of Requirement, requirements(:requirement_1)
assert_equal <at>requirements["requirement_1"]["name"],
requirements(:requirement_1).name
end
Now I''m
2008 Apr 29
0
Fixture Scenarios plugin
Just curious if anything special needs to be done to use the Rails
fixture scenarios plugin(http://code.google.com/p/fixture-scenarios/)
with rspec? Would I just create the "scenarios" inside the spec/fixtures
dir, as opposed to the test/fixtures dir?
Thanks,
Steve
2006 Nov 03
0
Fixture data persists across TestCases
I have a fixture file ''compositions.yml''. One TestCase uses this,
another doesn''t. However, the Compositions created from
compositions.yml persist across both test cases.
Is there any way of destroying fixture data once a test case is
complete?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google