Sha256: e696daa6294b24eb14f4fe221b6a92083936d7b038b994b2d52f54778f9645c0

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

require 'spec_helper'

describe Shoulda::Matchers::ActiveModel::RequireAValidIpMatcher do
  before :each do
    @server = Server.new
  end

  it 'should accept on ip' do
    expect(@server).to require_a_valid_ip(:ip)
  end

  it 'should accept without a specified attribute' do
    expect(@server).to require_a_valid_ip
  end

  it 'should reject on domain_name' do
    expect(@server).not_to require_a_valid_ip(:domain_name)
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validates_host-1.1.0 spec/validates_host/require_a_valid_ip_matcher_spec.rb