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.
54 lines
1.6 KiB
54 lines
1.6 KiB
11 years ago
|
#-- copyright
|
||
11 years ago
|
# OpenProject Meeting Plugin
|
||
|
#
|
||
|
# Copyright (C) 2011-2014 the OpenProject Foundation (OPF)
|
||
11 years ago
|
#
|
||
|
# This program is free software; you can redistribute it and/or
|
||
|
# modify it under the terms of the GNU General Public License version 3.
|
||
|
#
|
||
11 years ago
|
# 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.
|
||
|
#
|
||
11 years ago
|
# 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.
|
||
|
#
|
||
|
# See doc/COPYRIGHT.md for more details.
|
||
11 years ago
|
#++
|
||
|
|
||
12 years ago
|
require File.dirname(__FILE__) + '/../spec_helper'
|
||
14 years ago
|
|
||
10 years ago
|
describe 'MeetingMinutes', type: :model do
|
||
12 years ago
|
before do
|
||
7 years ago
|
@min = FactoryBot.build :meeting_minutes
|
||
14 years ago
|
end
|
||
|
|
||
|
# meeting minutes are editable when the meeting agenda is locked
|
||
10 years ago
|
describe '#editable?' do
|
||
14 years ago
|
before(:each) do
|
||
7 years ago
|
@mee = FactoryBot.build :meeting
|
||
14 years ago
|
@min.meeting = @mee
|
||
|
end
|
||
10 years ago
|
describe 'with no agenda present' do
|
||
|
it 'is not editable' do
|
||
11 years ago
|
expect(@min.editable?).to be_falsey
|
||
14 years ago
|
end
|
||
|
end
|
||
10 years ago
|
describe 'with an agenda present' do
|
||
14 years ago
|
before(:each) do
|
||
7 years ago
|
@a = FactoryBot.build :meeting_agenda
|
||
14 years ago
|
@mee.agenda = @a
|
||
|
end
|
||
10 years ago
|
it 'is not editable when the agenda is open' do
|
||
11 years ago
|
expect(@min.editable?).to be_falsey
|
||
14 years ago
|
end
|
||
10 years ago
|
it 'is editable when the agenda is closed' do
|
||
14 years ago
|
@a.lock!
|
||
11 years ago
|
expect(@min.editable?).to be_truthy
|
||
14 years ago
|
end
|
||
|
end
|
||
|
end
|
||
12 years ago
|
end
|