title: Is it okay to run for loops in functional test methods?
body: <p>Is it okay (conceptually) to run for loops in test methods?</p>
  
  <p>I'd like to test a range of parameter values into a controller, to determine if the different inputs return the correct values.</p>
  
  <pre><code>  test "logged in user - add something - 0 qty" do
      @app = Factory.create(:app)
  
      (0..5).each do |t|
        @qty = t
        login(:user)
        get :add. :id =&gt; @app.id, :qty =&gt; @qty
        assert_nil(flash[:error])
        assert_response :redirect
        assert_redirect_to :controller =&gt; :apps, :action =&gt; :show, :id =&gt; @app.id
        if @qty = 0 
          assert_equal(Invite.all.count, @qty + 1)
        else 
          assert_something .........
      end
    end
  </code></pre>
  
  <p>Something like that.</p>