Sha256: 1188dd80b792ef881b9233f5671f34fdd91cd560f046f90d08a68d0bfed7515d

Contents?: true

Size: 803 Bytes

Versions: 1

Compression:

Stored size: 803 Bytes

Contents

require 'spec_helper'

describe Agency do
  it { is_expected.to be_a_kind_of Unico::Agency }

  it 'return the name when call to_s' do
    subject.name = 'AgĂȘncia Santander'
    expect(subject.to_s).to eq 'AgĂȘncia Santander'
  end

  it 'should not validate presence of email' do
    subject.valid?
    expect(subject.errors[:email]).to be_empty
  end

  it { is_expected.to belong_to :bank }
  it { is_expected.to have_many :bank_accounts }

  it { is_expected.to validate_presence_of :name }
  it { is_expected.to validate_presence_of :number }
  it { is_expected.to validate_presence_of :digit }
  it { is_expected.to validate_presence_of :bank }

  it { is_expected.to allow_value('gabriel.sobrinho@gmail.com').for(:email) }
  it { is_expected.not_to allow_value('missing.host').for(:email) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unico-training-7.8.0 spec/models/agency_spec.rb