Sha256: ce54c680d53cedd15f00256035ddeacf168f4e325a80236e10dab999b0d22018

Contents?: true

Size: 612 Bytes

Versions: 2

Compression:

Stored size: 612 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

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

  it 'accepts on host_name' do
    expect(server).to require_a_valid_host_name(:host_name)
  end

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

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

  it 'has a description message' do
    expect(require_a_valid_host_name.description).to eq('require host_name to be a valid host name')
  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_host_name_matcher_spec.rb
validates_host-1.2.0 spec/shoulda/matchers/active_model/require_a_valid_host_name_matcher_spec.rb