Sha256: 8c310bfc5acc39fea481577c4bc292f810c8c1a93aba15566d4f2e4705d86ead

Contents?: true

Size: 878 Bytes

Versions: 39

Compression:

Stored size: 878 Bytes

Contents

ENV["RAILS_ENV"] ||= 'test'
require 'spec_helper'
require File.expand_path("../dummy/config/environment", __FILE__)
require 'rspec/rails'
require 'shoulda-matchers'
require 'factory_girl_rails'

# ActiveRecord::Migration.maintain_test_schema!

RSpec.configure do |config|
  config.include FactoryGirl::Syntax::Methods

  config.use_transactional_fixtures = true
  config.infer_spec_type_from_file_location!

  config.include(Shoulda::Matchers::ActiveModel, type: :model)
  config.include(Shoulda::Matchers::ActiveRecord, type: :model)

  config.before(:suite) do
    ActiveRecord::Base.connection.tables.each do |name|
      begin
        ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{name};")
      rescue ActiveRecord::StatementInvalid
        ActiveRecord::Base.connection.execute("delete from #{name};")
      end
    end
    Rails.application.load_seed
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
pulitzer-0.15.31 spec/rails_helper.rb
pulitzer-0.15.30 spec/rails_helper.rb
pulitzer-0.15.29 spec/rails_helper.rb
pulitzer-0.15.28 spec/rails_helper.rb
pulitzer-0.15.27 spec/rails_helper.rb
pulitzer-0.15.26 spec/rails_helper.rb
pulitzer-0.15.25 spec/rails_helper.rb
pulitzer-0.15.24 spec/rails_helper.rb
pulitzer-0.15.23 spec/rails_helper.rb
pulitzer-0.15.22 spec/rails_helper.rb
pulitzer-0.15.21 spec/rails_helper.rb
pulitzer-0.15.20 spec/rails_helper.rb
pulitzer-0.15.19 spec/rails_helper.rb
pulitzer-0.15.18 spec/rails_helper.rb
pulitzer-0.15.17 spec/rails_helper.rb
pulitzer-0.15.16 spec/rails_helper.rb
pulitzer-0.15.15 spec/rails_helper.rb
pulitzer-0.15.14 spec/rails_helper.rb
pulitzer-0.15.13 spec/rails_helper.rb
pulitzer-0.15.12 spec/rails_helper.rb