# Got a slightly more ambitious Rails functional test running

**URL:** <https://www.ruby-forum.com/t/got-a-slightly-more-ambitious-rails-functional-test-running/138537>\
**Category:** IronRuby\
**Created:** [May 24, 2008, 6:57am UTC](https://www.ruby-forum.com/t/got-a-slightly-more-ambitious-rails-functional-test-running/138537 "2008-05-24T06:57:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_LSSIRONRUBY](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Post date:** [May 24, 2008, 6:57am UTC](https://www.ruby-forum.com/t/got-a-slightly-more-ambitious-rails-functional-test-running/138537/1 "2008-05-24T06:57:37Z")

</div>

Here’s the controller:

class SayController \< ApplicationController  
def hello  
@name = ‘john’  
end  
end

Here’s the view template:

 Say Hello 
# Hello, \<%= @name%\>

Here’s the functional test:

require File.dirname( **FILE** ) + ‘/…/test\_helper’

class SayControllerTest \< ActionController::TestCase  
def test\_hello  
get :hello  
assert\_template “say/hello”  
assert\_response :success  
assert\_tag :tag =\> “h1”, :child =\> /john/  
end  
end

It hits a case where Rail uses Kernel#loop, so I implemented it.

It uncovered a couple of problems with how we implemented Hash#each\*.  
Ruby hashes can be modified from within the blocks that we yield to, but  
we were using foreach () to iterate over the underlying  
Dictionary\<object, object\>.

Both of these fixes are on my machine, and I’ll submit later once I get  
a connection back to corpnet.

We have WEBrick nearly running now. We are currently blocking on  
IO#select.

Thanks,  
-John
