No commit activity in last 3 years
No release in over 3 years
The gem minitest-rails-assertions extends MiniTest to add some assertions to Rails tests.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

< 5.0, >= 3.0
 Project Readme

Minitest::Rails::Assertions

Gem Version Build Status Code Climate Test Coverage

The gem minitest-rails-assertions extends MiniTest to add some assertions for Rails specific methods.

Installation

Add this line to your application's Gemfile:

gem 'minitest-rails-assertions'

And then execute:

$ bundle

Or install it yourself as:

$ gem install minitest-rails-assertions

Usage

Add in your test_helper.rb:

require 'minitest/rails/assertions'

Use the assertions like the Minitest assertion. For instance:

assert_length_of Product, :name, maximum: 30
assert_validates Product, :reference, format: { with: /\A\w\d{9}\z/i }, uniqueness: true

Contributing

  1. Fork it ( https://github.com/[my-github-username]/minitest-rails-assertions/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request