Add a close action to agendas. #2417
parent
7ec7a6b8ff
commit
23868446a7
@ -1,2 +1,5 @@ |
||||
class MeetingAgenda < MeetingContent |
||||
def lock! |
||||
update_attribute :locked, true |
||||
end |
||||
end |
@ -0,0 +1,11 @@ |
||||
class AddLockToMeetingContent < ActiveRecord::Migration |
||||
def self.up |
||||
add_column :meeting_contents, :locked, :boolean, :default => false |
||||
add_column :meeting_content_versions, :locked, :boolean, :default => nil |
||||
end |
||||
|
||||
def self.down |
||||
remove_column :meeting_contents, :locked |
||||
remove_column :meeting_content_versions, :locked |
||||
end |
||||
end |
@ -0,0 +1,4 @@ |
||||
Factory.define :meeting_agenda do |a| |
||||
# TODO: Wird das gebraucht? |
||||
#a.type "MeetingAgenda" |
||||
end |
@ -0,0 +1,17 @@ |
||||
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') |
||||
|
||||
describe "MeetingAgenda" do |
||||
before(:all) do |
||||
#@m = Factory.build :meeting, :title => "dingens" |
||||
@a = Factory.build :meeting_agenda, :text => "Some content...\n\nMore content!\n\nExtraordinary content!!" |
||||
end |
||||
|
||||
describe "#lock!" do |
||||
it "locks the agenda" do |
||||
@a.save |
||||
@a.lock! |
||||
@a.reload |
||||
@a.locked.should be_true |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue