Sha256: 72cb76e5d03037dfddc011332e66c39d7908708962de654dacadf77d161fd948
Contents?: true
Size: 1.09 KB
Versions: 37
Compression:
Stored size: 1.09 KB
Contents
require 'spec_helper' module Roqua module CoreApi module Models describe Person do let(:valid_person) { Person.new } describe '#new' do subject { Person.new firstname: 'first', lastname: 'last' } it 'accepts a hash of attributes' do expect(subject.firstname).to eq 'first' end end describe '#assign_attributes' do subject { Person.new firstname: 'first', lastname: 'last' } it 'accepts a hash of attributes' do subject.assign_attributes(firstname: 'new') expect(subject.firstname).to eq 'new' end end describe '#role' do it 'allows values: professional patient parent' do %w( professional patient parent ).each do |role| valid_person.role = role expect(valid_person.valid?).to be_truthy end end it 'does not allow other values' do valid_person.role = 'foobar' expect(valid_person.valid?).to be_falsy end end end end end end
Version data entries
37 entries across 37 versions & 1 rubygems