Created
March 14, 2012 06:23
-
-
Save pda/2034589 to your computer and use it in GitHub Desktop.
Revisions
-
pda revised this gist
Mar 14, 2012 . 1 changed file with 0 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,10 +28,6 @@ end end # Enter database configurations into ActiveRecord ActiveRecord::Base.send(:configurations=, YAML::load(ERB.new(IO.read(RAILS_ROOT + "config/database.yml")).result)) -
pda revised this gist
Mar 14, 2012 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,2 @@ mode = ENV["SPEC"] || "full" require_relative "spec_helper_#{mode}" -
pda created this gist
Mar 14, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ if ENV["COVERAGE"] require "simplecov" SimpleCov.start "rails" end mode = ENV["SPEC"] || "full" require_relative "spec_helper_#{mode}" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ require_relative "spec_helper_unit" ENV["RAILS_ENV"] ||= "test" # ActiveRecord require "yaml" require "active_record" ActiveRecord::Base.establish_connection( YAML.load(File.read(RAILS_ROOT + "config/database.yml"))["test"] ) # factory_girl require_relative "factories" require_relative "support/factory_girl" # DatabaseCleaner require "database_cleaner" RSpec.configure do |config| config.before(:suite) do DatabaseCleaner.strategy = :transaction DatabaseCleaner.clean_with(:truncation) end config.before(:each) do DatabaseCleaner.start end config.after(:each) do DatabaseCleaner.clean end end # Todo, autoload observers? ActiveRecord::Base.observers = [PaypalIpnObserver] ActiveRecord::Base.instantiate_observers # Enter database configurations into ActiveRecord ActiveRecord::Base.send(:configurations=, YAML::load(ERB.new(IO.read(RAILS_ROOT + "config/database.yml")).result)) # We hates Devise :( class ActiveRecord::Base def self.devise *parameters; end; def self.define_index *parameters; end#; def configurations; configs; end end module Devise; module Models; module Recoverable; end end end class User < ActiveRecord::Base; attr_writer :password; def self.has_own_preferences *parameters; end end require_relative "../app/models/user" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ require "pathname" RAILS_ROOT = Pathname.new(File.expand_path("../..", __FILE__)) # ActiveSupport require "active_support" require "active_support/dependencies" %w{ extensions forms helpers mailers models presenters scripts }.each do |dir| ActiveSupport::Dependencies.autoload_paths << File.expand_path("../../app/#{dir}", __FILE__) end