Displaying 20 results from an estimated 40 matches for "use_instantiated_fixtur".
Did you mean:
use_instantiated_fixtures
2006 Feb 22
2
self.use_instantiated_fixtures
Can this be controlled on a per TestCase basis, or is it only a global
setting?
David
2006 Nov 24
13
rSpec on Rails 1.2?
I just updated my Rails install to the most current Edge and my
controller specs fail:
1)
TypeError in ''The User Controller should be a user controller''
can''t convert nil into String
Each spec fails the same way.
<context string> <spec string>
can''t convert nil into String
Any ideas what''s up with this?
Thanks,
s.ross
2005 Dec 23
6
Agile book - test error
Hi all,
I get an error when testing the "store_controller_test.rb"
The troublesome line is in the test below:
def test_add_to_cart
get :add_to_cart, :id => @version_control_book.id <<<
cart = session[:cart]
assert_equal @version_control_book.price, cart.total_price
assert_redirected_to :action => ''display_cart''
follow_redirect
2006 May 05
7
Testing model: test becomes dependent on previous test
Im having trouble with Testing models. im following the tutorials in the
book Agile Web Development with Rails. if i execute the code
product_test.rb, i get this error:
============================================================
1) Failure:
test_update2(ProductTest) [test/unit/product_test.rb:30]:
<29.95> expected but was
<99.95>.
3 tests, 11 assertions, 1 failures, 0 errors
2007 Apr 30
7
Migrating spec_helper with modifications
Hello,
After moving into the HEAD of rspec, I am greeted with a mountain of errors,
which I expected, due to my specs not being migrated.
I use hpricot for a lot of my view tests, as it is extremely simple to
traverse the DOM with it. I used to include HpricotSpecHelper in
spec_helper.rb, like so:
require ''hpricot_spec_helper''
module Spec
module Rails
module Runner
2007 Mar 15
5
rake spec:views no transaction error
Hello,
I have recently upgraded to the 0.8.2 release of rSpec, and I am receiving
the following message with each view spec execution:
WARNING: there is no transaction in progress
I have upgraded the rspec_on_rails plugin as well, and both the model and
controller tests are working flawlessly. Is there some simple step I
missed? thanks for the input.
-Chris
-------------- next part
2008 Feb 12
4
Funny behavior with Fixtures... on Ubuntu..
...est 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 individually... as in:
ruby unit/task_test.rb --name test_update
The tests run successfully to completion. However, when I try to run the
entire test file in one go, I get failures. As in:
ruby unit/task_test.rb
> 8) Error:
> test_update(TaskTest):...
2006 Jan 11
3
Test fixtures not loaded
I have a problem with test fixtures. The data from the fixtures is
loaded into the db (MySQL) but the variables in the test cases are not
present. The logfiles contain nothing looking like an error.
Any hints what I could have done wrong? Or how to debug this situation?
thanks
Frank
2006 Jan 28
1
Unit Tests Take 2
Different question this time, and maybe only a core developer can answer.
In 1.0, use_instantiated_fixtures is turned off by default. What is the new
best-practice for not tying your tests to your test data?
Before you would use:
In clients.yml
first_client:
id: 1
name: Fred
In a test case:
def test_sometest
assert_equal @first_client.name, @client.name
end
With this s...
2006 Mar 04
2
unittest, not loading yml data
Here is my products.yml
version_control_book:
id: 1
title: Pragmatic Version Control
description: How to use version control
image_url: /images/sk_svn_small.jpg
price: 29.95
date_available: 2005-01-26 00:00:00
automation_book:
id: 2
title: Pragmatic Project Automation
description: How to automate your project
2007 Mar 19
3
rSpec on Rails Integration Testing
I see that there is an integration testing example in the plugin
code. What is the thinking about integration specs?
Thanks,
Steve
2008 Feb 18
5
uh... fixtures?
...s asking it.
I grabbed the source to Beast, to use as a Rails project uninfluenced by me, or
RSpec. Then I installed the CURRENT version of RSpec and rspec_on_rails, and set
up a model spec on Post.
Here''s the spec_helper.rb lines:
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + ''/test/fixtures/''
# borrow existing ones ^
config.global_fixtures = :posts, :topics, :users
And here''s a Beast test translated into a spec:
describe Post do
fixtures :forums, :moderatorships, :moni...
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
2007 May 12
3
[OT] - In Memory Databases
My specs are still taking to long to run in a rails app. Is anyone
using an in-memory database to run their specs? Any pointers or tips?
Scott
2006 Jun 08
2
accessing fixtures in tests
hi all,
my first attempt at tests and i''m having trouble accessing the
fixture values, if anyone can make it suggestions.
i have news_release_test.rb, using new_releases.yml as the fixture file
according to the agile book, i should be able to access the fixture
properties within my test as such:
assert_equal @first_test.id , @news_release.id
unfortunately, i try that and get:
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
2005 May 03
8
SQLite3 + RAM drive => 3 times faster unit tests
One problem I sort of always had with the ActiveRecord''s tight coupling
to the SQL backend is how slow it makes the unit tests. OK, there are
some ways to make it faster at a price of extra complexity (reusing the
fixtures, doing a rollback in the end of the test, etc), but still - it
is much slower than what I would like a unit test to be.
Today I had a very simple idea (why, oh why
2006 Apr 21
2
NoMethodError with test_read_with_hash
While running the product_test.rb test fixture in the Agile Web
Development book (p. 148), but when I run
ruby test/unit/product_test.rb, I get the following error:
1) Error:
test_read_with_hash(ProductTest):
NoMethodError: You have a nil object when you didn''t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]
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
2006 Mar 26
0
Another test problem
I hope there''s not a typo this time ;-)
With self.use_instantiated_fixtures = false in test_helper.rb (default
since 1.0 version) I want on demand instances.
This
@publish_articles[''article_linux'']
return a Fixture object (breakpointed, I see the data of fixture
fields). So I assume that publish_articles is well populated with
fixture datas
This
a...