2011-02-11 08:44:58 -05:00
|
|
|
module Capybara
|
|
|
|
module Features
|
|
|
|
def self.included(base)
|
|
|
|
base.instance_eval do
|
|
|
|
alias :background :before
|
|
|
|
alias :scenario :it
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-12 06:38:48 -05:00
|
|
|
def self.feature(*args, &block)
|
2011-02-11 08:44:58 -05:00
|
|
|
options = if args.last.is_a?(Hash) then args.pop else {} end
|
|
|
|
options[:capybara_feature] = true
|
|
|
|
options[:type] = :request
|
2011-03-13 09:31:04 -04:00
|
|
|
options[:caller] ||= caller
|
2011-02-11 08:44:58 -05:00
|
|
|
args.push(options)
|
|
|
|
|
|
|
|
describe(*args, &block)
|
|
|
|
end
|
|
|
|
|
|
|
|
RSpec.configuration.include Capybara::Features, :capybara_feature => true
|