@ -40,7 +40,8 @@ module API
get do
BudgetCollectionRepresenter.new(@budgets,
@budgets.count,
api_v3_paths.budgets_by_project(@project.id))
api_v3_paths.budgets_by_project(@project.id),
current_user: current_user)
end
@ -27,7 +27,7 @@ module API
@cost_type = cost_type
@spent_units = units
super(nil)
super(nil, current_user: nil)
linked_property :cost_type,
@ -45,7 +45,8 @@ module API
cost_entries = @cost_helper.cost_entries
CostEntryCollectionRepresenter.new(cost_entries,
cost_entries.count,
path)
path,
@ -35,7 +35,7 @@ describe ::API::V3::Budgets::BudgetRepresenter do
updated_on: Date.today)
}
let(:representer) { described_class.new(budget) }
let(:representer) { described_class.new(budget, current_user: user) }
context 'generation' do
subject(:generated) { representer.to_json }
@ -23,7 +23,7 @@ describe ::API::V3::CostEntries::CostEntryRepresenter do
include API::V3::Utilities::PathHelper
let(:cost_entry) { FactoryGirl.build(:cost_entry, id: 42) }
let(:representer) { described_class.new(cost_entry) }
let(:representer) { described_class.new(cost_entry, current_user: double('current_user')) }
subject { representer.to_json }
@ -23,7 +23,7 @@ describe ::API::V3::CostTypes::CostTypeRepresenter do
let(:cost_type) { FactoryGirl.build_stubbed(:cost_type) }
let(:representer) { described_class.new(cost_type) }
let(:representer) { described_class.new(cost_type, current_user: double('current_user')) }