Permalink
Browse files

install cucumber; port event_calendar scenarios

  • Loading branch information...
1 parent 20ac689 commit f0780dee315ada8ccf0939677f431f95a1e99547 @inertialbit inertialbit committed Feb 17, 2011
View
@@ -20,9 +20,11 @@ gem 'ruby-openid', :require => 'openid'
gem "will_paginate", "~> 3.0.pre2"
group :development, :test do
+ gem 'capybara'
+ gem 'cucumber-rails'
gem 'rspec-rails'
- gem 'webrat'
gem 'factory_girl'
+ gem 'webrat'
end
group :production do
View
@@ -50,6 +50,27 @@ GEM
authlogic
builder (2.1.2)
cancan (1.5.1)
+ capybara (0.4.1.1)
+ celerity (>= 0.7.9)
+ culerity (>= 0.2.4)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (>= 0.0.27)
+ xpath (~> 0.1.3)
+ celerity (0.8.7)
+ childprocess (0.1.6)
+ ffi (~> 0.6.3)
+ cucumber (0.10.0)
+ builder (>= 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.3.2)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ cucumber-rails (0.3.2)
+ cucumber (>= 0.8.0)
+ culerity (0.2.15)
diff-lcs (1.1.2)
erubis (2.6.6)
abstract (>= 1.0.0)
@@ -66,6 +87,8 @@ GEM
rails (= 3.0.3)
will_paginate (~> 3.0.pre2)
factory_girl (1.3.3)
+ ffi (0.6.3)
+ rake (>= 0.8.7)
file_share (0.1.8)
formtastic
formtastic
@@ -77,7 +100,11 @@ GEM
actionpack (>= 2.3.7)
activesupport (>= 2.3.7)
i18n (~> 0.4)
+ gherkin (2.3.3)
+ json (~> 1.4.6)
i18n (0.5.0)
+ json (1.4.6)
+ json_pure (1.5.1)
mail (2.2.15)
activesupport (>= 2.3.6)
i18n (>= 0.4.0)
@@ -124,9 +151,16 @@ GEM
railties (~> 3.0)
rspec (~> 2.5.0)
ruby-openid (2.1.8)
+ rubyzip (0.9.4)
+ selenium-webdriver (0.1.2)
+ childprocess (~> 0.1.5)
+ ffi (~> 0.6.3)
+ json_pure
+ rubyzip
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3)
+ term-ansicolor (1.0.5)
thor (0.14.6)
treetop (1.4.9)
polyglot (>= 0.3.1)
@@ -136,6 +170,8 @@ GEM
rack (>= 1.0)
rack-test (>= 0.5.3)
will_paginate (3.0.pre2)
+ xpath (0.1.3)
+ nokogiri (~> 1.3)
PLATFORMS
ruby
@@ -147,6 +183,8 @@ DEPENDENCIES
authlogic!
authlogic-oid
cancan
+ capybara
+ cucumber-rails
event_calendar_engine (~> 0.2.7)
factory_girl
file_share (~> 0.1.8)
View
@@ -0,0 +1,8 @@
+<%
+rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
+rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
+%>
+default: <%= std_opts %> features
+wip: --tags @wip:3 --wip features
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
@@ -0,0 +1,83 @@
+Feature: Event calendar
+
+ Background: I am logged in
+ Given I am logged in as "admin" user "joe"
+
+ Scenario: create a new event spanning multiple days
+ When I follow "Site Admin"
+ And I follow "Manage Events"
+ And I follow "Create New Event"
+ And I fill in "Name" with "Some New Event"
+ And I fill in "Event type" with "Seminar"
+ And I fill in "Start date" with "10/14/2010"
+ And I fill in "End date" with "10/17/2010"
+ And I fill in "Facilitators" with "Jonathan Wizzlepod, DSM NPSO"
+ And I fill in "Presenters" with "Jane Doe, Professor Statistical Analysis UO"
+ And I fill in "Location" with "Eugene, Oregon"
+ And I fill in "Description" with "There will be 4 speakers during 8 hours..."
+ And I press "Create Event"
+ Then I should see "Event was successfully created."
+
+ Scenario: create a new event w/out an explicit end date
+ Given I am on the new event page
+ When I fill in "Name" with "Some implied event ending"
+ And I fill in "Event type" with "Conference"
+ And I select "11" from "event[start_time(4i)]"
+ And I select "30" from "event[start_time(5i)]"
+ And I fill in "Start date" with "02/26/2011"
+ And I press "Create Event"
+ Then I should see "Event was successfully created."
+ And I should see "Some implied event ending (Conference)"
+ And I should see "Date: Saturday, February 26 2011"
+ And I should see "Time: 02:30 PM - 03:30 PM Eastern / 01:30 PM - 02:30 PM Central / 12:30 PM - 01:30 PM Mountain / 11:30 AM - 12:30 PM Pacific"
+
+ Scenario: create a new event w/ only an explicit start date
+ Given I am on the new event page
+ When I fill in "Name" with "Some implied start and end time"
+ And I fill in "Event type" with "Meeting"
+ And I fill in "Start date" with "03/04/2011"
+ And I press "Create Event"
+ Then I should see "Event was successfully created."
+ And I should see "Some implied start and end time"
+ And I should see "Date: Friday, March 04 2011"
+ And I should see "Time: 09:00 AM - 10:00 AM Eastern / 08:00 AM - 09:00 AM Central / 07:00 AM - 08:00 AM Mountain / 06:00 AM - 07:00 AM Pacific"
+
+ Scenario: update a multi day event
+ Given I am on the event page for "Editable Event"
+ And I follow "edit" within "div.event"
+ And I fill in "Name" with "Updated Event"
+ And I press "Update Event"
+ Then I should see "Event was successfully updated."
+
+ Scenario: update a single day event
+ Given I am on the event page for "Linkable Event"
+ And I follow "edit" within "div.event"
+ And I fill in "Start date" with "02/23/2011"
+ And I fill in "End date" with "02/23/2011"
+ And I select "Pacific Time (US & Canada)" from "Timezone"
+ And I press "Update Event"
+ Then I should be on the event page for "Linkable Event"
+ And I should see "Time: 09:00 AM - 10:00 AM Eastern / 08:00 AM - 09:00 AM Central / 07:00 AM - 08:00 AM Mountain / 06:00 AM - 07:00 AM Pacific"
+
+ Scenario: delete an event
+ Given I am on the event page for "Editable Event"
+ And I follow "delete" within "div.event"
+ Then I should be on the events page
+
+ Scenario: deleting then restoring an event
+ Given I am on the event page for "Restorable Event"
+ Then I should see "Time: 09:00 AM - 10:00 AM Eastern / 08:00 AM - 09:00 AM Central / 07:00 AM - 08:00 AM Mountain / 06:00 AM - 07:00 AM Pacific"
+ And I follow "delete"
+ Then I should be on the events page
+ When I go to the manage events page
+ And I follow "Browse Deleted Events"
+ Then I should be on the event revisions page
+ And I should see "Restorable Event"
+ And I should see "2011"
+ And I should see "February"
+ And I should see "Friday 4th"
+ And I should see "09:00 AM - 10:00 AM Eastern / 08:00 AM - 09:00 AM Central / 07:00 AM - 08:00 AM Mountain / 06:00 AM - 07:00 AM Pacific"
+ When I follow "restore"
+ Then I should be on the event page for "Restorable Event"
+ And I should see "Date: Friday, February 04 2011"
+ And I should see "Time: 09:00 AM - 10:00 AM Eastern / 08:00 AM - 09:00 AM Central / 07:00 AM - 08:00 AM Mountain / 06:00 AM - 07:00 AM Pacific"
@@ -0,0 +1,23 @@
+Given /I am logged in as "([^"]*)" user "([^"]*)"/ do |type, username|
+ steps %Q{
+ Given a "#{type}" user "#{username}"
+ When I go to the login page
+ And I fill in "Username" with "#{username}"
+ And I fill in "Password" with "test-pass"
+ And I press "Login"
+ Then I should see "Login successful!"
+ }
+end
+
+Given /a "([^"]*)" user "([^"]*)"/ do |type, username|
+ User.create!({
+ :login => username,
+ :email => "#{username}@test.com",
+ :password => 'test-pass',
+ :password_confirmation => 'test-pass',
+ :first_name => username.capitalize,
+ :last_name => username.reverse.capitalize,
+ :is_admin => type == 'admin'
+ })
+ User.count.should > 0
+end
@@ -0,0 +1,6 @@
+Then /I should see the current month and year/ do
+ steps %Q{
+ Then I should see "#{Date.current.strftime('%B')}"
+ And I should see "#{Date.current.year}"
+ }
+end
Oops, something went wrong.

0 comments on commit f0780de

Please sign in to comment.