aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-08 18:20:05 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-10 18:21:04 +0200
commitcdabbcd4c068bf4591998b33a769187683eef17f (patch)
tree368426c4fb38096331d35626943d93a576f11fc6 /site/spec/models/participation_spec.rb
parentReceive list of meeting participants from IRC bot (diff)
downloadcouncil-webapp-cdabbcd4c068bf4591998b33a769187683eef17f.tar.gz
council-webapp-cdabbcd4c068bf4591998b33a769187683eef17f.tar.bz2
council-webapp-cdabbcd4c068bf4591998b33a769187683eef17f.zip
Handle proxies attendance
Mark council member who appointed proxy as present, not proxy.
Diffstat (limited to 'site/spec/models/participation_spec.rb')
-rw-r--r--site/spec/models/participation_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/site/spec/models/participation_spec.rb b/site/spec/models/participation_spec.rb
index 242abde..395dc03 100644
--- a/site/spec/models/participation_spec.rb
+++ b/site/spec/models/participation_spec.rb
@@ -25,15 +25,21 @@ describe Participation do
a = Factory(:agenda)
Factory(:agenda, :state => 'old')
+ Factory(:proxy, :proxy => u.first,
+ :council_member => non_participants.last,
+ :agenda => a)
+
results_hash = {
'Whatever' => { u[0].irc_nick => 'Yes', u[1].irc_nick => 'Yes', u[2].irc_nick => 'Yes'},
'Something else' => { u[0].irc_nick => 'Yes', u[1].irc_nick => 'No'}
}
+ present = u - [u.first] + [non_participants.last]
Participation.mark_participations(results_hash)
- (Participation.all.*.irc_nick - u.*.irc_nick).should be_empty
- (u.*.irc_nick - Participation.all.*.irc_nick).should be_empty
- (u - Participation.all.*.participant).should be_empty
+ (Participation.all.*.irc_nick - present.*.irc_nick).should be_empty
+ (present.*.irc_nick - Participation.all.*.irc_nick).should be_empty
+ (present - Participation.all.*.participant).should be_empty
+ (Participation.all.*.participant - present).should be_empty
end
end
end