diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-06-06 21:15:25 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-06-10 18:12:21 +0200 |
commit | 1faf786442e393fd56cfc1a016196d87f64825f8 (patch) | |
tree | d2c1d0a31a05f91ef9bb713abcfd244c2487b5eb /site/spec/models/agenda_spec.rb | |
parent | Send email reminders about meetings using delayed_job (diff) | |
download | council-webapp-1faf786442e393fd56cfc1a016196d87f64825f8.tar.gz council-webapp-1faf786442e393fd56cfc1a016196d87f64825f8.tar.bz2 council-webapp-1faf786442e393fd56cfc1a016196d87f64825f8.zip |
agenda/reminders page lists users that bot should remind about meeting
and gives some additional information to avoid multiple pings
Diffstat (limited to 'site/spec/models/agenda_spec.rb')
-rw-r--r-- | site/spec/models/agenda_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/site/spec/models/agenda_spec.rb b/site/spec/models/agenda_spec.rb index 83b31a3..32fa2ba 100644 --- a/site/spec/models/agenda_spec.rb +++ b/site/spec/models/agenda_spec.rb @@ -188,4 +188,22 @@ describe Agenda do UserMailer.should_not_receive(:delay) Agenda.send_current_agenda_reminders end + + it 'should return proper irc_reminders hash' do + CustomConfig['Reminders']["hours_befeore_meeting_to_send_irc_reminders"] = 2 + + a1 = Factory(:agenda) + users = users_factory([:council]*2 + [:user]*2) + Agenda.irc_reminders.keys.should include('remind_time') + Agenda.irc_reminders.keys.should include('message') + Agenda.irc_reminders.keys.should include('users') + + Agenda.irc_reminders['remind_time'].should == Agenda.current.meeting_time.strftime('%a %b %d %H:%M:%S %Y') + Agenda.irc_reminders['users'].should == Agenda.voters + + a1.meeting_time = 10.years.from_now + a1.save! + + Agenda.irc_reminders.should be_empty + end end |