Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save guipdutra/5950226 to your computer and use it in GitHub Desktop.
Save guipdutra/5950226 to your computer and use it in GitHub Desktop.
# encoding: utf-8
require 'spec_helper'
require 'model_helper'
describe BudgetAllocationCapabilityChange do
describe '#update_budget_allocation_capability' do
context "when capability has movements" do
it "returns error" do
capability = Capability.make!(:reforma, :pledges => [Pledge.make!(:empenho)])
budget = BudgetAllocationCapabilityChange.create(:budget_allocation_id => BudgetAllocation.make(:alocacao).id,
:budget_allocation_capability => BudgetAllocationCapability.make!(:capability),
:regulatory_act => RegulatoryAct.make!(:sopa),
:current_capability => capability,
:updated_capability => Capability.make!(:reforma))
require 'pry'; binding.pry
expect(subject.errors[:current_capability]).to include "Há movimentações para este recurso."
end
end
context "when capability doesnt has movements" do
it "update the budget_allocation capability" do
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment