Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'test_helper'
- class OperationTest < ActiveSupport::TestCase
- context "A valid operation" do
- setup do
- @operation = Factory(:operation_one)
- end
- should_require_attributes :description, :value
- should "return its value" do
- assert_equal 5000, @operation.value
- end
- should "return its category" do
- assert_equal 'Proventos', @operation.category
- end
- context "with value greater than zero" do
- should "be income" do
- operation = Factory(:operation_one)
- assert operation.income?
- end
- end
- context "with value less than zero" do
- should "be expense" do
- operation = Factory(:operation_two)
- assert operation.expense?
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment