kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.9 KiB
57 lines
1.9 KiB
10 years ago
|
#-- copyright
|
||
|
# OpenProject Costs Plugin
|
||
|
#
|
||
|
# Copyright (C) 2009 - 2014 the OpenProject Foundation (OPF)
|
||
|
#
|
||
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License
|
||
|
# version 3.
|
||
|
#
|
||
|
# This program is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with this program; if not, write to the Free Software
|
||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
#++
|
||
|
|
||
|
require 'spec_helper'
|
||
|
|
||
10 years ago
|
describe ::API::V3::Budgets::BudgetRepresenter do
|
||
10 years ago
|
let(:project) { FactoryGirl.build(:project, id: 999) }
|
||
|
let(:user) { FactoryGirl.build(:user,
|
||
|
member_in_project: project,
|
||
|
created_on: 1.day.ago,
|
||
|
updated_on: Date.today) }
|
||
|
let(:cost_object) { FactoryGirl.build(:cost_object,
|
||
|
author: user,
|
||
|
project: project,
|
||
|
created_on: 1.day.ago,
|
||
|
updated_on: Date.today) }
|
||
|
|
||
10 years ago
|
let(:representer) { described_class.new(cost_object) }
|
||
10 years ago
|
|
||
|
context 'generation' do
|
||
|
subject(:generated) { representer.to_json }
|
||
|
|
||
10 years ago
|
it { should include_json('Budget'.to_json).at_path('_type') }
|
||
10 years ago
|
|
||
|
describe 'cost_object' do
|
||
|
it { should have_json_path('id') }
|
||
|
|
||
|
it { should have_json_path('description') }
|
||
|
|
||
|
it { should have_json_path('projectId') }
|
||
|
it { should have_json_path('projectName') }
|
||
|
|
||
|
it { should have_json_path('subject') }
|
||
|
it { should have_json_path('type') }
|
||
|
|
||
|
it { should have_json_path('createdAt') }
|
||
|
it { should have_json_path('updatedAt') }
|
||
|
end
|
||
|
end
|
||
|
end
|