spec/models/expense_spec.rb in expense_gun-1.0.2 vs spec/models/expense_spec.rb in expense_gun-1.0.3
- old
+ new
@@ -150,17 +150,17 @@
expense.expense_lines << FactoryGirl.build(:expense_line, total_all_taxes: 10, company_part: 100)
expense.expense_lines << FactoryGirl.build(:expense_line, total_all_taxes: 10, company_part: 50)
expect(expense.total_employee_payback).to eq 15.0
end
- it "#total_vat_deductible should return sum of lines" do
+ it "#total_vat_deductible should return sum of lines" do
expense = FactoryGirl.build(:expense, expense_lines: [])
category1 = FactoryGirl.build(:category, vat_deductible: true)
category2 = FactoryGirl.build(:category, vat_deductible: false)
- expense.expense_lines << FactoryGirl.build(:expense_line, vat: 10, category: category1)
- expense.expense_lines << FactoryGirl.build(:expense_line, vat: 10, category: category2)
- expect(expense.total_vat_deductible).to eq 10.0
+ expense.expense_lines << FactoryGirl.build(:expense_line, vat: 10, category: category1, company_part: 50)
+ expense.expense_lines << FactoryGirl.build(:expense_line, vat: 10, category: category2, company_part: 50)
+ expect(expense.total_vat_deductible).to eq 5.0
end
it "#may_edit? should return false unless expense is not submited" do
expect(ExpenseGun::Expense.new(state: :new).may_edit?).to be true
expect(ExpenseGun::Expense.new(state: :submited).may_edit?).to be false
@@ -176,6 +176,6 @@
expense.destroy
expense_line_ids.map do |id|
expect(ExpenseGun::ExpenseLine.exists?(id)).to be false
end
end
-end
\ No newline at end of file
+end