Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added selenium, cucumber, and webrat
- Loading branch information
Shereef Bishay
committed
Nov 16, 2009
1 parent
6e2a5c0
commit 368570d
Showing
28 changed files
with
328 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,4 +53,8 @@ demo: | |
|
||
|
||
cucumber: | ||
<<: *TEST | ||
<<: *TEST | ||
|
||
selenium: | ||
<<: *TEST | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# IMPORTANT: This file was generated by Cucumber 0.4.3 | ||
# Edit at your own peril - it's recommended to regenerate this file | ||
# in the future when you upgrade to a newer version of Cucumber. | ||
|
||
config.cache_classes = true # This must be true for Cucumber to operate correctly! | ||
|
||
# Log error messages when you accidentally call methods on nil. | ||
config.whiny_nils = true | ||
|
||
# Show full error reports and disable caching | ||
config.action_controller.consider_all_requests_local = true | ||
config.action_controller.perform_caching = false | ||
|
||
# Disable request forgery protection in test environment | ||
config.action_controller.allow_forgery_protection = false | ||
|
||
# Tell Action Mailer not to deliver emails to the real world. | ||
# The :test delivery method accumulates sent emails in the | ||
# ActionMailer::Base.deliveries array. | ||
config.action_mailer.delivery_method = :test | ||
|
||
config.gem 'cucumber', :lib => false, :version => '>=0.4.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/cucumber')) | ||
config.gem 'webrat', :lib => false, :version => '>=0.5.3' unless File.directory?(File.join(Rails.root, 'vendor/plugins/webrat')) | ||
config.gem 'rspec', :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec')) | ||
config.gem 'rspec-rails', :lib => false, :version => '>=1.2.9' unless File.directory?(File.join(Rails.root, 'vendor/plugins/rspec-rails')) | ||
|
||
require 'rubygems' | ||
require 'factory_girl' | ||
|
||
gem 'pickle' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,8 @@ test: &TEST | |
cname_bucket: false | ||
|
||
cucumber: | ||
<<: *TEST | ||
<<: *TEST | ||
|
||
selenium: | ||
<<: *TEST | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
default: --tags ~@selenium -r features/support/env.rb -r features/step_definitions features | ||
selenium: --tags @selenium -r features/support/env.rb -r features/support/selenium.rb -r features/step_definitions features |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,6 @@ def self.up | |
end | ||
|
||
def self.down | ||
drop_table mails | ||
drop_table :mails | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# this file generated by script/generate pickle email | ||
|
||
ActionMailer::Base.delivery_method = :test | ||
ActionMailer::Base.perform_deliveries = true | ||
|
||
Before do | ||
ActionMailer::Base.deliveries.clear | ||
end | ||
|
||
Given(/^all emails? (?:have|has) been delivered$/) do | ||
ActionMailer::Base.deliveries.clear | ||
end | ||
|
||
Given(/^(\d)+ emails? should be delivered$/) do |count| | ||
emails.size.should == count.to_i | ||
end | ||
|
||
Then(/^(\d)+ emails? should be delivered to (.*)$/) do |count, to| | ||
to =~ /^#{capture_model}$/ && to = model($1).email | ||
emails("to: \"#{to}\"").size.should == count.to_i | ||
end | ||
|
||
Then(/^(\d)+ emails? should be delivered with #{capture_fields}$/) do |count, fields| | ||
emails(fields).size.should == count.to_i | ||
end | ||
|
||
Then(/^#{capture_email} should be delivered to (.+)$/) do |email_ref, to| | ||
to =~ /^#{capture_model}$/ && to = model($1).email | ||
email(email_ref, "to: \"#{to}\"").should_not be_nil | ||
end | ||
|
||
Then(/^#{capture_email} should have #{capture_fields}$/) do |email_ref, fields| | ||
email(email_ref, fields).should_not be_nil | ||
end | ||
|
||
Then(/^#{capture_email} should contain "(.*)"$/) do |email_ref, text| | ||
email(email_ref).body.should =~ /#{text}/ | ||
end | ||
|
||
Then(/^#{capture_email} should not contain "(.*)"$/) do |email_ref, text| | ||
email(email_ref).body.should_not =~ /#{text}/ | ||
end | ||
|
||
Then(/^#{capture_email} should link to (.+)$/) do |email_ref, page| | ||
email(email_ref).body.should =~ /#{path_to(page)}/ | ||
end | ||
|
||
Then(/^show me the emails?$/) do | ||
save_and_open_emails | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Given /^the following (.+) records?$/ do |factory, table| | ||
# # table is a Cucumber::Ast::Table | ||
# table.hashes.each do |hash| | ||
# Factory(factory,hash) | ||
# end | ||
# end | ||
# | ||
Given /^I am logged in as ([^\"]*)$/ do |username| | ||
Then "Login in as #{username} with password #{username}" | ||
end | ||
|
||
|
||
Given /^Login in as ([^\"]*) with password ([^\"]*)$/ do |username, password| | ||
visit url_for(:controller => 'account', :action => 'login') | ||
fill_in "Login", :with => username | ||
fill_in "Password", :with => password | ||
click_button "Login" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Given /^I am a ([^\"]*) of project "([^\"]*)"$/ do |role, project| | ||
Given "#{User.current.login} is a #{role} of project \"#{project}\"" | ||
end | ||
|
||
|
||
Given /([^\"]*) is a ([^\"]*) of project "([^\"]*)"$/ do |user,role, project| | ||
@project = Project.find(:first, :conditions => {:name => project}) | ||
@role = Role.find(:first, :conditions => {:name => role}) | ||
m = Member.new(:user => User.find(:first, :conditions => {:login => user}), :roles => [@role]) | ||
@project.members << m | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# require 'database_cleaner' | ||
# DatabaseCleaner.clean_with :truncation # clean once to ensure clean slate | ||
# DatabaseCleaner.strategy = :truncation | ||
# | ||
# Before('@no-txn') do | ||
# DatabaseCleaner.start | ||
# end | ||
# | ||
# # After('@no-txn') do | ||
# # DatabaseCleaner.clean | ||
# # end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.