Sha256: 8e84032f37e01bc38b8fa6ed8c25cb24b874c54ddc7f5946e340603160e0ad4a

Contents?: true

Size: 1.03 KB

Versions: 7

Compression:

Stored size: 1.03 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../test_helper.rb')

class ProductsControllerTest < ActionController::IntegrationTest

  def setup
    @controller = ProductsController.new
  end

  context "Notifier Middleware" do
    test "Show notification of a not tested GET request" do
      get "/products/new"

      assert_notify_for(:products, :new, :get)
    end

    test "Show notification of a not tested POST request" do
      post "/products"

      assert_notify_for(:products, :create, :post)
    end

    test "Show notification of a not tested DELETE request" do
      delete "/products/1"

      assert_notify_for(:products, :destroy, :delete)
    end

    test "Show notification of a not tested PUT request" do
      put "/products/1"

      assert_notify_for(:products, :update, :put)
    end

    test "Not show notifications for tested routes" do
      get "/products"
      assert_watched_routes_include(:products, :index, :get)
      get "/products"
      assert_not_notify_for(:products, :index, :get)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
route_dog-2.5.1 test/integration/products_controller_test.rb
route_dog-2.5.0 test/integration/products_controller_test.rb
route_dog-2.4.2 test/integration/products_controller_test.rb
route_dog-2.3.1 test/integration/products_controller_test.rb
route_dog-2.3.0 test/integration/products_controller_test.rb
route_dog-2.2.0 test/integration/products_controller_test.rb
route_dog-2.0.1 test/integration/products_controller_test.rb