fully merged webrat merb branch with brynary. File upload tests still fail, will look at later

This commit is contained in:
Rob Kaufman 2008-10-11 17:09:15 -07:00
parent dbb3883d27
commit 264b147b6f
6 changed files with 25 additions and 12 deletions

View File

@ -10,9 +10,4 @@ require "active_support"
require File.dirname(__FILE__) + "/webrat/core"
require File.dirname(__FILE__) + "/webrat/rails" if defined?(RAILS_ENV)
if defined?(Merb)
require File.join(File.dirname(__FILE__), "boot_merb.rb")
else
require File.join(File.dirname(__FILE__), "boot_rails.rb")
end
require File.join(File.dirname(__FILE__), "boot_merb.rb") if defined?(Merb)

View File

@ -82,12 +82,11 @@ module Webrat
# along with the form. An optional <tt>content_type</tt> may be given.
#
# Example:
<<<<<<< HEAD:lib/webrat/core/scope.rb
# attaches_file "Resume", "/path/to/the/resume.txt"
# attaches_file "Photo", "/path/to/the/image.png", "image/png"
def attaches_file(id_or_name_or_label, path, content_type = nil)
find_field(id_or_name_or_label, FileField).set(path, content_type)
=======
end
# save_and_open
def save_and_open
return unless File.exist?(Webrat.root + "/tmp")
@ -97,7 +96,6 @@ module Webrat
f.write response.body
end
`open tmp/#{filename}`
>>>>>>> 300880db2f0d50a3e2d7b171eb9745cb50e1c534:lib/webrat/page.rb
end
alias_method :attach_file, :attaches_file

View File

@ -1,5 +1,5 @@
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")
unless ENV["TEST_MODE"] == "merb"
describe "attaches_file" do
before do
@session = Webrat::TestSession.new
@ -70,3 +70,4 @@ describe "attaches_file" do
@session.clicks_button
end
end
end

View File

@ -5,9 +5,11 @@ require "spec"
begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end
if ["rails","merb"].include?(ENV["TEST_MODE"])
require File.join(File.dirname(__FILE__), "helper_#{ENV["TEST_MODE"]}.rb")
require File.join(File.dirname(__FILE__), "webrat", "#{ENV["TEST_MODE"]}", "helper.rb")
else
raise "Please set the environment variable TEST_MODE to either 'rails' or 'merb'."
puts "Please set the environment variable TEST_MODE to either 'rails' or 'merb'."
$stdout.flush
exit 1
end
require File.expand_path(File.dirname(__FILE__) + "/../lib/webrat")

View File

@ -0,0 +1,11 @@
require 'merb-core'
require 'merb_stories'
# module Merb
# module Test
# class RspecStory
# def flunk(message)
# raise message
# end
# end
# end
# end

View File

@ -0,0 +1,6 @@
require "active_support"
silence_warnings do
require "action_controller"
require "action_controller/integration"
end