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
config.gem "polyglot", :lib => false, :version => ">= 0.2.5" # Necessária para a internacionalização | |
config.gem "hpricot", :lib => false, :version => ">= 0.8.1" # Ferramenta de parsing necessária | |
config.gem "treetop", :lib => false, :version => ">= 1.2.5" # Metalinguagem | |
# É um componente esssencial do cucumber | |
config.gem "term-ansicolor", :lib => false, :version => ">= 1.0.3" # Utilizada para colorir a saída no terminal | |
config.gem "webrat", :lib => false, :version => ">= 0.4.4" # Ferramenta para testes funcionais |
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
Funcionalidade: Gerenciar Contatos | |
Como um usuário | |
Eu quero gerenciar contatos | |
Para contatar as pessoas mais facilmente | |
Contexto: | |
Dado que existem os seguintes registros de contato: | |
| nome | email | | |
| Contato de Teste 1 | [email protected] | | |
| Contato de Teste 2 | [email protected] | |
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
Dado /^que existe\(m\) (\d+) registro\(s\) de (.+)$/ do |n, model_str| | |
model_str = model_str.gsub(/\s/, '_') | |
model_sym = model_str.to_sym | |
classe = eval(model_str.camelize) | |
classe.transaction do | |
classe.destroy_all | |
n.to_i.times do | |
Factory(model_sym) | |
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
<% | |
@selenium_opts = '-r features/support/selenium.rb' | |
@webrat_opts = '-r features/support/webrat.rb' | |
@rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
def rerun? | |
[email protected]_s.strip.empty? | |
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
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks | |
vendored_cucumber_bin = Dir["#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first | |
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? | |
begin | |
require 'cucumber/rake/task' | |
namespace :cucumber do | |
namespace :webrat do |
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
<% | |
@selenium_opts = '-r features/support/selenium.rb -e features/step_definitions/webrat' | |
@webrat_opts = '-r features/support/webrat.rb -e features/step_definitions/selenium' | |
@rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
def rerun? | |
[email protected]_s.strip.empty? | |
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
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. | |
# It is recommended to regenerate this file in the future when you upgrade to a | |
# newer version of cucumber-rails. Consider adding your own code to a new file | |
# instead of editing this one. Cucumber will automatically load all features/**/*.rb | |
# files. | |
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks | |
vendored_cucumber_bin = Dir["#{RAILS_ROOT}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first |
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
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. | |
# It is recommended to regenerate this file in the future when you upgrade to a | |
# newer version of cucumber-rails. Consider adding your own code to a new file | |
# instead of editing this one. Cucumber will automatically load all features/**/*.rb | |
# files. | |
ENV["RAILS_ENV"] ||= "cucumber" | |
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support |
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
Webrat.configure do |config| | |
config.mode = :selenium | |
end | |
Cucumber::Rails::World.use_transactional_fixtures = false | |
World(Webrat::Selenium::Matchers) | |
require 'database_cleaner' | |
DatabaseCleaner.strategy = :truncation |
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
Webrat.configure do |config| | |
config.mode = :rails | |
config.open_error_files = false # Set to true if you want error pages to pop up in the browser | |
end |
OlderNewer