Sha256: 9e653725b6158514e2e6de78564e43d154c3c9b2b484db3a837522bb5d5723c4

Contents?: true

Size: 561 Bytes

Versions: 6

Compression:

Stored size: 561 Bytes

Contents

RSpec.describe Commons::Concerns::Attributes::Sex do
  let(:sex) { Commons::Concerns::Attributes::Sex::FEMALE }
  let(:user) { build(:user, name: 'rosa del barrio', last_name: 'hernandez', sex: sex) }

  subject do
    user
  end

  describe 'works ok!' do
    it 'when valid data' do
      expect(subject.sex).to eq sex
      expect(subject.female_sex?).to be true
    end
  end

  describe 'fails' do
    subject do
      user = User.new(sex: 'sex')
    end
    it 'when invalid sex' do
      expect{ subject }.to raise_error(ArgumentError)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
commons_yellowme-0.16.0 spec/commons/concerns/attributes/sex_spec.rb
commons_yellowme-0.15.0 spec/commons/concerns/attributes/sex_spec.rb
commons_yellowme-0.12.0 spec/commons/concerns/attributes/sex_spec.rb
commons_yellowme-0.11.3 spec/commons/concerns/attributes/sex_spec.rb
commons_yellowme-0.11.2 spec/commons/concerns/attributes/sex_spec.rb
commons_yellowme-0.11.1 spec/commons/concerns/attributes/sex_spec.rb