Sha256: 19e8fc2ab6a4c0585dd18fe66c868c7f37af211d1ef944095379580f7123a499

Contents?: true

Size: 550 Bytes

Versions: 2

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Shoulda::Matchers::ActiveModel::RequireAValidIpMatcher do
  let(:server) { Server.new }

  it 'accepts on ip' do
    expect(server).to require_a_valid_ip(:ip)
  end

  it 'accepts without a specified attribute' do
    expect(server).to require_a_valid_ip
  end

  it 'rejects on domain_name' do
    expect(server).not_to require_a_valid_ip(:domain_name)
  end

  it 'has a description message' do
    expect(require_a_valid_ip.description).to eq('require ip to be a valid ip')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
validates_host-1.3.0 spec/shoulda/matchers/active_model/require_a_valid_ip_matcher_spec.rb
validates_host-1.2.0 spec/shoulda/matchers/active_model/require_a_valid_ip_matcher_spec.rb