I want to use rspec with my application where we don’t have database.
I want to know how to use fixtures with out ORM layer.
On Mar 17, 2010, at 6:25 PM, harinionrails wrote:
I want to use rspec with my application where we don’t have database.
The answer to this is in spec/spec_helper.rb (lines 16 - 21), which is
generated when you run “script/generate rspec” in the root of your rails
app:
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
# from the project root directory.
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment'))
require 'spec/autorun'
require 'spec/rails'
# Uncomment the next line to use webrat's matchers
#require 'webrat/integrations/rspec-rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
Spec::Runner.configure do |config|
# If you're not using ActiveRecord you should remove these
# lines, delete config/database.yml and disable :active_record
# in your config/boot.rb
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
This file has been truncated. show original
I want to know how to use fixtures with out ORM layer.
Rails fixtures are specifically intended for use with an ORM layer.
Without one, you’ll have to roll your own test data.
HTH,
David
On Thursday 18 March 2010 00.25:51 harinionrails wrote:
I want to use rspec with my application where we don’t have database.
I want to know how to use fixtures with out ORM layer.
Probably those fixtures are now called ‘stubs’.