Low commit activity in last 3 years
A long-lived project that still receives updates
Writing specs for complex validations is annoying. AcceptValuesFor makes iteasy to test your validations with real world values, asserting which valuesshould be accepted by your model and which should not.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2
~> 13.0

Runtime

>= 3.10, < 4.0
>= 6.1, < 8.0
 Project Readme

AcceptValuesFor

Writing specs for complex validations is annoying. AcceptValuesFor makes it easy to test your validations with real world values, asserting which values should be accepted by your model and which should not.

Read the original blog post.

Gem Version Build Status Code Climate

Usage

describe User do
  describe "validation" do
    subject(:user) { User.new }

    it { should accept_values_for(:email, "john@example.com", "jane@example.org") }
    it { should_not accept_values_for(:email, nil, " ", "john", "john@example") }
  end
end

Dependencies

  • Active Model (6, 7)
  • RSpec (3)

Installation

Gemfile

group :test do
  gem "accept_values_for"
end

Self-Promotion

Like AcceptValuesFor?

Watch the repository on GitHub and read my blog.