aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-05-18 17:19:38 +0200
committerJoachim Filip Ignacy Bartosik <jbartosik@gmail.com>2011-06-01 15:21:14 +0200
commit4b874a907e16dcfb61cc82a69f9c3891bff1bfa8 (patch)
treed364ca3c0983cfd383c550792df6529443ed8bbe /site/features
parentMeetBot plugin from Debian (diff)
downloadcouncil-webapp-4b874a907e16dcfb61cc82a69f9c3891bff1bfa8.tar.gz
council-webapp-4b874a907e16dcfb61cc82a69f9c3891bff1bfa8.tar.bz2
council-webapp-4b874a907e16dcfb61cc82a69f9c3891bff1bfa8.zip
Application provides data for IRC bot
Diffstat (limited to 'site/features')
-rw-r--r--site/features/step_definitions/voting_steps.rb22
-rw-r--r--site/features/step_definitions/within_steps.rb4
-rw-r--r--site/features/support/paths.rb7
-rw-r--r--site/features/voting.feature23
4 files changed, 55 insertions, 1 deletions
diff --git a/site/features/step_definitions/voting_steps.rb b/site/features/step_definitions/voting_steps.rb
new file mode 100644
index 0000000..0519397
--- /dev/null
+++ b/site/features/step_definitions/voting_steps.rb
@@ -0,0 +1,22 @@
+When /^I follow first agenda item link$/ do
+ When "I follow \"#{AgendaItem.first.title}\""
+end
+
+When /^I add example voting option$/ do
+ When 'I fill in "voting_option_description" with "example"'
+ When 'I press "Add a voting option"'
+end
+
+Given /^example voting option$/ do
+ Given 'example agenda item'
+ VotingOption.new(:description => 'example', :agenda_item => AgendaItem.last).save!
+end
+
+When /^I go from the homepage to edit last voting option page$/ do
+ When 'I am on the homepage'
+ When 'I follow "Agendas"'
+ When 'I follow link to current agenda'
+ When "I follow \"#{AgendaItem.last.title}\""
+ When "I follow \"#{VotingOption.last.description}\""
+ When 'I follow "Edit Voting option"'
+end
diff --git a/site/features/step_definitions/within_steps.rb b/site/features/step_definitions/within_steps.rb
index 7d56fc4..57bf030 100644
--- a/site/features/step_definitions/within_steps.rb
+++ b/site/features/step_definitions/within_steps.rb
@@ -9,7 +9,9 @@
'in the agendas collection' => '.collection.agendas',
'as empty collection message' => '.empty-collection-message',
'as meeting time' => '.meeting-time-view',
- 'as the user nick' => '.user-irc-nick'
+ 'as the user nick' => '.user-irc-nick',
+ 'as voting option' => '.collection.voting-options',
+ 'as voting option description' => '.voting-option-description'
}.
each do |within, selector|
Then /^I should( not)? see "([^"]*)" #{within}$/ do |negation, text|
diff --git a/site/features/support/paths.rb b/site/features/support/paths.rb
index ab24b9e..6f8dad8 100644
--- a/site/features/support/paths.rb
+++ b/site/features/support/paths.rb
@@ -23,6 +23,13 @@ module NavigationHelpers
when /the first suggested agenda page/
agenda_item_path(AgendaItem.first(:conditions => {:agenda_id => nil}))
+ when /the voters page/
+ voters_path
+
+ when /the current items page/
+ current_items_path
+
+ # Add more mappings here.
# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
#
diff --git a/site/features/voting.feature b/site/features/voting.feature
new file mode 100644
index 0000000..2e25318
--- /dev/null
+++ b/site/features/voting.feature
@@ -0,0 +1,23 @@
+Feature: Application side of voting
+ In order to handle voting with IRC bot
+ I want application to help with that
+
+ Scenario: Add voting option
+ Given example agenda item
+ And an agenda
+ And some council members
+ And I am logged in as council member
+ When I am on the current agenda page
+ And I follow first agenda item link
+ And I add example voting option
+ Then I should see "example" as voting option
+
+ Scenario: Edit voting option
+ Given example voting option
+ Given an agenda
+ And some council members
+ And I am logged in as council member
+ When I go from the homepage to edit last voting option page
+ And I fill in "voting_option_description" with "some description"
+ And I press "Save Voting option"
+ Then I should see "some description" as voting option description