Sha256: 27e735df46f5fc9fa38fe0583723bde52c52eb26710c90b324714d55ededdd5e

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

# RSpec::AllRecordsValidator

Check all ActiveRecord object validation after system spec.

This gem is designed for: [rspec-rails](https://github.com/rspec/rspec-rails)

## Setup

### Install 

Add this line to your application's Gemfile in test group:

```ruby
group :test do
  gem 'rspec-all_records_validator'
end
```

And then execute:

```
$ bundle install
```

### Configure

Add below to your `spec_helper.rb`

```ruby
require 'rspec/all_records_validator'

RSpec.configure do |config|
  config.after type: :system do
    RSpec::AllRecordsValidator.validate!
  end
end
```

#### Avoid validation for specific model 

You can avoid validation for specific models:

```ruby
RSpec.configure do |config|
  config.after type: :system do
    RSpec::AllRecordsValidator.validate!(ignored_models: [DoNotValidateThisModel])
  end
end
```

#### For feature spec

You can config This setting for feature spec

```ruby
RSpec.configure do |config|
  config.after type: :feature do
    RSpec::AllRecordsValidator.validate!
  end
end
```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-all_records_validator-0.0.7 README.md