[#257 state:awaiting-patch] here is a test proving the issue

This commit is contained in:
mike.gaffney 2009-06-02 17:23:12 -05:00
parent 2704609224
commit bd1655c8e2
7 changed files with 35 additions and 16 deletions

View File

@ -0,0 +1,4 @@
class FieldsController < ApplicationController
def show
end
end

View File

@ -0,0 +1,2 @@
module FieldsHelper
end

View File

@ -0,0 +1,8 @@
<h1>Webrat Fields Page</h1>
<h2>Filling In</h2>
<ul>
<li><input type="text" name="field_by_name" value="" /></li>
<li><input type="text" name="rails[naming]" value="" /></li>
<li><input type="text" id="field_by_id" value="" /></li>
<li><label for="field_by_label_id">FieldByLabelId</label><input type="text" id="field_by_label_id" /></li>
</ul>

View File

@ -1,6 +1,7 @@
ActionController::Routing::Routes.draw do |map| ActionController::Routing::Routes.draw do |map|
map.resource 'links', :only => [:show] map.resource 'links', :only => [:show]
map.resource 'buttons', :only => [:show, :create] map.resource 'buttons', :only => [:show, :create]
map.resource 'fields', :only => [:show]
map.with_options :controller => "webrat" do |webrat| map.with_options :controller => "webrat" do |webrat|
webrat.submit "/submit", :action => "submit" webrat.submit "/submit", :action => "submit"
webrat.internal_redirect "/internal_redirect", :action => "internal_redirect" webrat.internal_redirect "/internal_redirect", :action => "internal_redirect"

View File

@ -1,8 +0,0 @@
require 'test_helper'
class ButtonsControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View File

@ -1,8 +0,0 @@
require 'test_helper'
class LinksControllerTest < ActionController::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

View File

@ -0,0 +1,20 @@
require 'test_helper'
class FillInTest < ActionController::IntegrationTest
test "should fill in text field by name" do
visit fields_path
fill_in "field_by_name", :with => "value"
end
test "should fill in text field by name, rails naming lh257" do
visit fields_path
fill_in "rails[naming]", :with => "value"
end
test "should fill in text field by id" do
visit fields_path
fill_in "field_by_id", :with => "value"
end
test "should fill in text field by label via id" do
visit fields_path
fill_in "FieldByLabelId", :with => "value"
end
end