Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPO-2941: Support for Rails 5.1/5.2 #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
== 0.8.0 / 2022-10-04

* Minor enhancements

* Webrat::RailsAdapter#do_request uses keyword arguments for data and headers to support Rails 5.1+

== 0.7.5 / 2011-11-19

* Minor enhancements
Expand Down Expand Up @@ -57,7 +63,7 @@
* Removed save_and_open_page's rewriting of static asset paths before saving (was not actually working) (Noah Davis)
* Make "should contain" ignore extra whitespace when doing string comparisons (Noah Davis)
* Make selenium matchers handle negative match more consistently with positive match (Luke Melia)

== 0.6.0 / 2009-11-28

REMOVED: Support for Hpricot + REXML as an alternative to Nokogiri.
Expand Down
2 changes: 1 addition & 1 deletion lib/webrat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "nokogiri"

module Webrat
VERSION = "0.7.3"
VERSION = "0.8.0"

autoload :MechanizeAdapter, "webrat/adapters/mechanize"
autoload :MerbAdapter, "webrat/adapters/merb"
Expand Down
6 changes: 3 additions & 3 deletions lib/webrat/adapters/rails.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require "webrat/integrations/rails"
require "action_controller/record_identifier"
require "action_view/record_identifier"

module Webrat
class RailsAdapter #:nodoc:
include ActionController::RecordIdentifier
include ActionView::RecordIdentifier

attr_reader :integration_session

Expand Down Expand Up @@ -47,7 +47,7 @@ def xml_content_type?

def do_request(http_method, url, data, headers) #:nodoc:
update_protocol(url)
integration_session.send(http_method, normalize_url(url), data, headers)
integration_session.send(http_method, normalize_url(url), params: data, headers: headers)
end

# remove protocol, host and anchor
Expand Down
4 changes: 2 additions & 2 deletions lib/webrat/integrations/rack.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
if defined?(ActionController::IntegrationTest)
module ActionController #:nodoc:
if defined?(ActionDispatch::IntegrationTest)
module ActionDispatch #:nodoc:
IntegrationTest.class_eval do
include Rack::Test::Methods
include Webrat::Methods
Expand Down
6 changes: 3 additions & 3 deletions lib/webrat/integrations/rails.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "action_controller"
require "action_controller/integration"
require "action_dispatch"
require "action_dispatch/testing/integration"

module ActionController #:nodoc:
module ActionDispatch #:nodoc:
IntegrationTest.class_eval do
include Webrat::Methods
include Webrat::Matchers
Expand Down
2 changes: 1 addition & 1 deletion lib/webrat/integrations/selenium.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "webrat/selenium"

if defined?(ActionController::IntegrationTest)
if defined?(ActionDispatch::IntegrationTest)
module ActionController #:nodoc:
IntegrationTest.class_eval do
include Webrat::Methods
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class ButtonClickTest < ActionController::IntegrationTest
class ButtonClickTest < ActionDispatch::IntegrationTest
# <button type="submit" ...>
test "should click button with type submit by id" do
visit buttons_path
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/rails/test/integration/fill_in_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class FillInTest < ActionController::IntegrationTest
class FillInTest < ActionDispatch::IntegrationTest
test "should fill in text field by name" do
visit fields_path
fill_in "field_by_name", :with => "value"
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/rails/test/integration/link_click_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class LinkClickTest < ActionController::IntegrationTest
class LinkClickTest < ActionDispatch::IntegrationTest
test "should click link by text" do
visit links_path
click_link "LinkByText"
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/rails/test/integration/webrat_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'test_helper'

class WebratTest < ActionController::IntegrationTest
class WebratTest < ActionDispatch::IntegrationTest

#Firefox raises a security concern under Selenium
unless ENV['WEBRAT_INTEGRATION_MODE'] == 'selenium'
Expand Down
2 changes: 1 addition & 1 deletion webrat.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = %q{webrat}
s.version = "0.7.5"
s.version = "0.8.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Bryan Helmkamp"]
Expand Down