Sha256: ea1a6dbc30ed9fbd64848a5ec165ca6eb225fa2ee0ff97251aa61b896858c2c3

Contents?: true

Size: 873 Bytes

Versions: 1

Compression:

Stored size: 873 Bytes

Contents

require 'rails_helper'

RSpec.describe Peoplefinder::PeopleHelper, type: :helper do
  it "returns a name for each day" do
    expect(day_name(:works_wednesday)).to eql("Wednesday")
  end

  it "returns a symbol for each day" do
    expect(day_symbol(:works_wednesday)).to eql("W")
  end

  context '#contact_details' do
    it 'correctly formats complete contact details' do
      person = create(:person, email: 'hello@example.com', primary_phone_number: '0207 123 45678', secondary_phone_number: '0777-999-999')
      expect(contact_details(person)).to eql("<a href=\"mailto:hello@example.com\">hello@example.com</a><br/>0207 123 45678<br/>0777-999-999")
    end

    it 'correctly formats incomplete contact details' do
      person = create(:person, primary_phone_number: '0777-999-999')
      expect(contact_details(person)).to match(/0777-999-999/)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
peoplefinder-0.0.2 spec/helpers/peoplefinder/people_helper_spec.rb