Skip to content
This repository was archived by the owner on Jan 8, 2021. It is now read-only.

redding/assert-rails4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

=== This has been archived and is not maintained. ===

AssertRails4

AssertRails adapter for Rails 4. See https://github.com/redding/assert-rails for reference.

Usage

Reset the test db for test runs

# in test/helper.rb
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)

require "assert-rails4"
AssertRails.reset_db

Running database tests in a transaction

# in test/helper.rb
require "assert-rails4"
class DbTests < AssertRails::DbTests
  # put any extra setup / teardown logic here
end

Then in a test that needs to interact with the database:

require "assert"
require "blog_record"

class BlogRecord

  class SystemTests < DbTests
    # all tests in this context will be run in a transaction
  end

end

Installation

Add this line to your application's Gemfile:

gem "assert-rails4"

And then execute:

$ bundle

Or install it yourself as:

$ gem install assert-rails4

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am "Added some feature")
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

AssertRails adapter for Rails 4.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages