2024-12-28 17:27:28 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-10-28 22:07:35 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2024-07-11 19:55:48 +02:00
|
|
|
require 'rails_helper'
|
|
|
|
|
2024-12-28 17:27:28 +01:00
|
|
|
RSpec.describe Expense do
|
2024-11-16 10:22:10 +01:00
|
|
|
describe 'validations' do
|
2024-12-28 17:27:28 +01:00
|
|
|
it { is_expected.to validate_presence_of(:name) }
|
|
|
|
it { is_expected.to validate_presence_of(:amount) }
|
|
|
|
it { is_expected.to validate_numericality_of(:amount).is_greater_than(0) }
|
|
|
|
it { is_expected.to validate_presence_of(:pricing_type) }
|
2024-11-16 10:22:10 +01:00
|
|
|
end
|
2024-07-11 19:55:48 +02:00
|
|
|
end
|