aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-08 19:02:32 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-10 18:30:37 +0200
commit53201e0add36dd0ca796fa349108bc533890eedb (patch)
tree1284107c1b987b0fcd45ea70738b15f81df7710f /site/features
parentHandle proxies attendance (diff)
downloadcouncil-webapp-53201e0add36dd0ca796fa349108bc533890eedb.tar.gz
council-webapp-53201e0add36dd0ca796fa349108bc533890eedb.tar.bz2
council-webapp-53201e0add36dd0ca796fa349108bc533890eedb.zip
Show slacking information in the application
Using participations
Diffstat (limited to 'site/features')
-rw-r--r--site/features/participations.feature11
-rw-r--r--site/features/step_definitions/participations_steps.rb59
2 files changed, 70 insertions, 0 deletions
diff --git a/site/features/participations.feature b/site/features/participations.feature
index d273541..9b45e1b 100644
--- a/site/features/participations.feature
+++ b/site/features/participations.feature
@@ -8,3 +8,14 @@ Feature: In order to track presence on the council meetings
When application got voting results from IRC bot
And I am on the current agenda page
Then I should see some council members as participants
+
+ Scenario: View council slacking status
+ Given council term started a year ago
+ And some agendas
+ And some council members who attended properly
+ And some council members who skipped last meeting
+ And some slackers
+ And some slackers who skipped a meeting
+ When I am on the home page
+ And I follow "Current council attendance"
+ Then I should see list of all council members with proper indication of their attendance
diff --git a/site/features/step_definitions/participations_steps.rb b/site/features/step_definitions/participations_steps.rb
index b97e563..e4b48b6 100644
--- a/site/features/step_definitions/participations_steps.rb
+++ b/site/features/step_definitions/participations_steps.rb
@@ -27,3 +27,62 @@ Then /^I should see some council members as participants$/ do
Then "I should see \"#{User.first.name}\" within \".collection.participations.participations-collection\""
Then "I should see \"#{User.last.name}\" within \".collection.participations.participations-collection\""
end
+
+Given /^some agendas$/ do
+ for i in 1..11
+ Factory(:agenda, :state => 'old', :meeting_time => i.months.ago)
+ end
+ Factory(:agenda)
+end
+
+Given /^some council members who attended properly$/ do
+ users = users_factory([:council]*3)
+ for a in Agenda.all
+ for u in users
+ Factory(:participation, :participant => u, :agenda => a)
+ end
+ end
+end
+
+Given /^some council members who skipped last meeting$/ do
+ users = users_factory([:council]*3)
+ for a in Agenda.all - [Agenda.last]
+ for u in users
+ Factory(:participation, :participant => u, :agenda => a)
+ end
+ end
+end
+
+Given /^some slackers$/ do
+ users = users_factory([:council]*3)
+ i = 0
+ for a in Agenda.all
+ next if i < 2
+ for u in users
+ Factory(:participation, :participant => u, :agenda => a)
+ end
+ end
+end
+
+Given /^some slackers who skipped a meeting$/ do
+ users = users_factory([:council]*3)
+ i = 0
+ for a in Agenda.all - [Agenda.last]
+ next if i < 2
+ for u in users
+ Factory(:participation, :participant => u, :agenda => a)
+ end
+ end
+end
+
+Given /^council term started a year ago$/ do
+ CustomConfig['CouncilTerm']['start_time'] = 1.year.ago
+end
+
+Then /^I should see list of all council members with proper indication of their attendance$/ do
+ start = CustomConfig['CouncilTerm']['start_time']
+ stop = Agenda.current.meeting_time - 1.minute
+ for user in User.council_member_is(true)
+ Then "I should see \"#{user.name} - #{user.slacking_status_in_period(start, stop)}\" within \".collection.slacking-statuses\""
+ end
+end