Displaying 20 results from an estimated 1100 matches similar to: "How to stop Rspec loading my Cucumber fixtures"
2008 Feb 18
5
uh... fixtures?
RSpec-ers:
I''m aware this is quite the FAQ. I have probably asked it myself, but I just
can''t Google up anything but others 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:
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
2006 Jan 24
0
Fixtures subdirectories
Hi,
[This is a repost, I can?t find where went my previous post,
]
I wanted to create subdirectories in the fixtures directory in order to be
able to manage many different initial states for my system (or to sort
fixtures / corresponding model subpackages).
I came up with the idea of writing:
Test::Unit::TestCase.fixture_path = RAILS_ROOT + "/test/fixtures/selling"
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
2009 Mar 19
6
[Cucumber 0.2] Failure to use should
I have a step definition like this:
Then "the account should be created" do
account = Account.find_by_name("my shiny new account")
p account.class
account.should_not be_blank
end
When running this step, I got the error message:
Account(id: integer, name: string, state: string, next_renewal_at: date,
created_at: datetime, updated_at: datetime, full_domain: string,
2008 Feb 12
4
Funny behavior with Fixtures... on Ubuntu..
Hey Guys,
I''ve got a test 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
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
2005 Dec 23
2
SQLite in-memory
I left ":memory:" in database.yml for testing and the most simple
tests in the Agile book do not work (see trace below for test_truth).
Since that''s what comes with the distributed database.yml I suppose
it''s me doing something wrong.
Did someone get SQLite ":memory:" working? How does it grab the schema?
-- fxn
% rake test_units
(in
2011 Feb 25
7
Rspec2 for rails 2.3.8?
Hi experts,
I picked up a copy of the rspec book and wrote some tests in spec/lib
and spec/models for my Rails 2.3.8 code.
I was using rspec 2.5.1, rspec-core 2.5.0, rspec-expectations 2.5.0 et.
al.
But I realised that the rspec-rails version I am using is meant for
Rails3.
Which version of rspec-rails should I use for Rails 2.3.8?
Best,
Radhesh
--
Posted via http://www.ruby-forum.com/.
2011 Jan 20
11
RSpec / Cucumber painfully slow Rails 3 OSX
I am working on my first Rails BDD project with extensive tests since
starting out with Rails a few years ago.
Running RSpec or Cucumber is really slow. I''m using Rails 3 and RSpec
2.
To run one model spec with only 5 tests takes almost 1 minute! When it
finishes it says it took only 0.9 seconds to run the actual test. So
obviously it is loading the environment that takes so long. I just
2007 Aug 31
3
Setting use_transactional_fixtures=false for a single spec - a bad idea?
Hi!
I would really like to find a way to allow me to write RSpec
specifications for code that use database transactions. I know I can set
config.use_transactional_fixtures = false
in my spec_helper.rb. That works, and that''s great, but it will (I
think) slow down my specs quite a bit. I would like to turn off
transactional fixtures for just a single spec (describe), or even
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi
I just did an update to lates trunk
=================
context "Given a generated venue_spec.rb with fixtures loaded" do
fixtures :venues
specify "fixtures should load two Venues" do
Venue.should have(2).records
end
end
==================
gives me
==========
1)
TypeError in ''Given a generated venue_spec.rb with fixtures loaded
fixtures should load two
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
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 Jun 28
2
undefined method `use_transactional_fixtures=''
Folks,
I checked my test_helper.rb and it has
self.use_transactional_fixtures = true
My code was generated with 1.1.2 and I''m using 1.1.3 right now after
but the error persists.
I googled for this issue and it appears that a require is missing or
something like that. I can''t figure it out, please help!
/opt/local/bin/ruby -Ilib:test
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 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 Apr 02
0
Fixtures.create_fixtures with any desired filenames?
Hi all
I''d like to create fixtures using
Fixtures.create_fixtures
But it seems that this one needs .yml files that have the same name like
the table they correspond to:
countries.yml => my_db.countries
readers.yml => my_db.readers
Is it possible to use any desired filenames somehow?
some_cool_countries.yml => my_db.countries
some_other_cool_countries.yml =>
2007 Jul 09
12
Mocking User.find( :all, :limit => 10 )
Hi,
I''m trying to setup a mock for my controller test but I can''t get it to
recognise the mock.
I use
it "should find all users" do
User.should_receive(:find).with( :all, :limit => 10
).and_return([@user])
do_get
end
and in the controller
@users = User.find(:all, :limit => 10 )
But this does not work. It gives me
User expected :find with (:all)
2008 Mar 14
2
Lib Specs and config.use_transactional_fixtures = true
Hi
We have specs in our rails project other than model/view/controller ..
we have interests and lib ...
using use_transactional_fixtures = true seems fine in a spec in the m/
v/c and interests directories but not in lib
Just wondered if anyone had any quick thoughts as to why that may be???
Shane Mingins
ELC Technologies (TM)
1921 State Street
Santa Barbara, CA 93101
Phone: +64 4 568