aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'site/spec/models/agenda_spec.rb')
-rw-r--r--site/spec/models/agenda_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/site/spec/models/agenda_spec.rb b/site/spec/models/agenda_spec.rb
index b84f462..05212d0 100644
--- a/site/spec/models/agenda_spec.rb
+++ b/site/spec/models/agenda_spec.rb
@@ -233,6 +233,18 @@ describe Agenda do
end
end
+ describe '#current?' do
+ it 'should create new agenda if needed' do
+ Agenda.count.should be_zero
+ agenda = Agenda.current
+ agenda2 = Agenda.current
+ agenda.should be_a(Agenda)
+ agenda2.should be_a(Agenda)
+ Agenda.count.should be_equal(1)
+ agenda.id.should be_equal(agenda2.id)
+ end
+ end
+
it 'should return proper voting_array' do
old_agenda = Factory(:agenda, :state => 'old')
current_agenda = Factory(:agenda)