diff options
author | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-05-12 13:50:18 +0200 |
---|---|---|
committer | Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> | 2011-05-24 18:55:38 +0200 |
commit | b158deb751714013e730fae449f9e3d9fa3dce00 (patch) | |
tree | e4f02f07bbf9e1538248655de321cd22af3caa9c /site/features | |
parent | Start using factory_girl (diff) | |
download | council-webapp-b158deb751714013e730fae449f9e3d9fa3dce00.tar.gz council-webapp-b158deb751714013e730fae449f9e3d9fa3dce00.tar.bz2 council-webapp-b158deb751714013e730fae449f9e3d9fa3dce00.zip |
Agenda model
Diffstat (limited to 'site/features')
-rw-r--r-- | site/features/agendas.feature | 15 | ||||
-rw-r--r-- | site/features/step_definitions/agenda_steps.rb | 12 | ||||
-rw-r--r-- | site/features/step_definitions/irc_nick_steps.rb | 2 | ||||
-rw-r--r-- | site/features/step_definitions/within_steps.rb | 4 |
4 files changed, 32 insertions, 1 deletions
diff --git a/site/features/agendas.feature b/site/features/agendas.feature new file mode 100644 index 0000000..77267a5 --- /dev/null +++ b/site/features/agendas.feature @@ -0,0 +1,15 @@ +Feature: Agendas + In order to manage meetings + I want to have agendas + + Scenario: View agendas listing as a guest + When I am on the homepage + And I follow "Agendas" + Then I should not see "Agenda" in the content body + + Given an agenda + When I follow "Agendas" + Then I should see "Agenda" in the agendas collection + + When I follow link to first agenda + Then I should see current date as meeting time diff --git a/site/features/step_definitions/agenda_steps.rb b/site/features/step_definitions/agenda_steps.rb new file mode 100644 index 0000000..95c7406 --- /dev/null +++ b/site/features/step_definitions/agenda_steps.rb @@ -0,0 +1,12 @@ +Given /^an agenda$/ do + Agenda.new(:meeting_time => Time.now).save! +end + +Then /^I should see current date as meeting time$/ do + Then "I should see \"#{Time.now.strftime("%Y-%m-%d")}\" as meeting time" +end + +When /^I follow link to first agenda$/ do + link_text = page.find(:xpath, "//a[contains(@class, 'agenda-link')]").text + When "I follow \"#{link_text}\"" +end diff --git a/site/features/step_definitions/irc_nick_steps.rb b/site/features/step_definitions/irc_nick_steps.rb index acaa4f8..5daf44f 100644 --- a/site/features/step_definitions/irc_nick_steps.rb +++ b/site/features/step_definitions/irc_nick_steps.rb @@ -1,7 +1,7 @@ When /^I fill in example user registration data$/ do When "I fill in the following:", table(%{ |user_name|examle| - |user_email_address|example@example.com| + |user_email|example@example.com| |user_irc_nick|example| |user_password|Example| |user_password_confirmation|Example| diff --git a/site/features/step_definitions/within_steps.rb b/site/features/step_definitions/within_steps.rb index 76b0ad6..3f42f37 100644 --- a/site/features/step_definitions/within_steps.rb +++ b/site/features/step_definitions/within_steps.rb @@ -1,6 +1,10 @@ { 'in the notices' => '.flash.notice', 'in the errors' => '.error-messages', + 'in the content body' => '.content-body', + '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' }. each do |within, selector| |