Moved merb files to be more in line with current webrat layout

This commit is contained in:
Rob Kaufman 2008-10-17 19:41:24 -07:00
parent 264b147b6f
commit b8e76a1af2
11 changed files with 6 additions and 68 deletions

View File

@ -1,39 +0,0 @@
module ActionController
module Integration
class Session
unless instance_methods.include?("put_via_redirect")
include Webrat::RedirectActions
end
def current_page
@current_page ||= Webrat::Page.new(self)
end
def current_page=(new_page)
@current_page = new_page
end
# Issues a GET request for a page, follows any redirects, and verifies the final page
# load was successful.
#
# Example:
# visits "/"
def visits(*args)
@current_page = Webrat::Page.new(self, *args)
end
def save_and_open_page
current_page.save_and_open
end
[:reloads, :fills_in, :clicks_button, :selects, :chooses, :checks, :unchecks, :clicks_link, :clicks_link_within, :clicks_put_link, :clicks_get_link, :clicks_post_link, :clicks_delete_link].each do |method_name|
define_method(method_name) do |*args|
current_page.send(method_name, *args)
end
end
end
end
end

View File

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

View File

@ -118,10 +118,10 @@ end
#here because we're only loaded in Test mode. #here because we're only loaded in Test mode.
require 'strscan' require 'strscan'
require 'cgi' require 'cgi'
require File.join(File.dirname(__FILE__), "merb_support", "param_parser.rb") require File.join(File.dirname(__FILE__), "merb", "param_parser.rb")
require File.join(File.dirname(__FILE__), "merb_support", "url_encoded_pair_parser.rb") require File.join(File.dirname(__FILE__), "merb", "url_encoded_pair_parser.rb")
require File.join(File.dirname(__FILE__), "merb_support", "indifferent_access.rb") require File.join(File.dirname(__FILE__), "merb", "indifferent_access.rb")
require File.join(File.dirname(__FILE__), "merb_support", "support.rb") require File.join(File.dirname(__FILE__), "merb", "support.rb")

View File

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

View File

@ -1,5 +1,4 @@
require 'merb-core' require 'merb-core'
require 'merb_stories'
# module Merb # module Merb
# module Test # module Test
# class RspecStory # class RspecStory

View File

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

View File

@ -1,11 +0,0 @@
require "active_support"
silence_warnings do
require "action_controller"
require "action_controller/integration"
end
class ActionController::Integration::Session
def flunk(message)
raise message
end
end