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.
62 lines
1.7 KiB
62 lines
1.7 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 'MeetingAgenda', type: :model do
|
||
12 years ago
|
before(:each) do
|
||
7 years ago
|
@a = FactoryBot.build :meeting_agenda, text: "Some content...\n\nMore content!\n\nExtraordinary content!!"
|
||
14 years ago
|
end
|
||
11 years ago
|
|
||
14 years ago
|
# TODO: Test the right user and messages are set in the history
|
||
10 years ago
|
describe '#lock!' do
|
||
|
it 'locks the agenda' do
|
||
14 years ago
|
@a.save
|
||
13 years ago
|
@a.reload
|
||
14 years ago
|
@a.lock!
|
||
|
@a.reload
|
||
11 years ago
|
expect(@a.locked).to be_truthy
|
||
14 years ago
|
end
|
||
|
end
|
||
11 years ago
|
|
||
10 years ago
|
describe '#unlock!' do
|
||
|
it 'unlocks the agenda' do
|
||
14 years ago
|
@a.locked = true
|
||
|
@a.save
|
||
13 years ago
|
@a.reload
|
||
14 years ago
|
@a.unlock!
|
||
|
@a.reload
|
||
11 years ago
|
expect(@a.locked).to be_falsey
|
||
14 years ago
|
end
|
||
|
end
|
||
11 years ago
|
|
||
14 years ago
|
# a meeting agenda is editable when it is not locked
|
||
10 years ago
|
describe '#editable?' do
|
||
|
it 'is editable when not locked' do
|
||
12 years ago
|
@a.locked = false
|
||
11 years ago
|
expect(@a.editable?).to be_truthy
|
||
14 years ago
|
end
|
||
10 years ago
|
it 'is not editable when locked' do
|
||
14 years ago
|
@a.locked = true
|
||
11 years ago
|
expect(@a.editable?).to be_falsey
|
||
14 years ago
|
end
|
||
|
end
|
||
13 years ago
|
end
|