user } it { is_expected.to belong_to(:company) } it { is_expected.to have_many(:restaurants).through(:company) } it { is_expected.to have_secure_password } it { is_expected.to_not allow_value(nil).for(:name) } it { is_expected.to_not allow_value(nil).for(:password) } it { is_expected.to_not allow_value(nil).for(:mail_address) } it { is_expected.to validate_length_of(:zipcode1).is_at_most(3) } it { is_expected.to validate_length_of(:zipcode2).is_at_most(4) } it { is_expected.to validate_numericality_of(:zipcode1).only_integer } it { is_expected.to validate_numericality_of(:zipcode2).only_integer } end