Yes but to check, functional tests check wether the functionality expected is delivered or not whereas integration tests make sure the code fits well and doesn't break due to changes.

-----Original Message-----
From: "Andrew White" <notifications@github.com>
Sent: ‎01-‎08-‎2013 02:12
To: "ujjwalt/rails" <rails@noreply.github.com>
Cc: "Ujjwal Thaakar" <ujjwalthaakar@gmail.com>
Subject: Re: [rails] Default Collection Routing (#1)

In actionpack/test/dispatch/routing_test.rb:
> @@ -3607,3 +3607,20 @@ def test_route_defaults_are_not_required_for_url_for
>      assert_equal '/projects/1', url_for(controller: 'projects', action: 'show', id: 1, only_path: true)
>    end
>  end
> +
> +class TestCollectionRouting < ActionDispatch::IntegrationTest
> +  Routes = ActionDispatch::Routing::RouteSet.new.tap do |app|
> +    app.draw do
> +      resources :posts
> +    end
> +  end
> +
> +  include Routes.url_helpers
> +  include ActionDispatch::Assertions::RoutingAssertions
> +  def app; Routes end
> +
> +  test "collection" do
> +    opts = {controller: "post", action: "replace"}
> +    assert_recognizes opts, path: "/posts", method: 'put'
The assert_recognizes is a functional/controller tests assertion whereas this is an integration test - you need to check the status, response, etc. Look at how the other tests in this file are structured.
Do you understand the difference between functional tests and integration tests in the Rails framework?
—
Reply to this email directly or view it on GitHub.