aboutsummaryrefslogblamecommitdiffstats
path: root/actionpack/test/controller/spec_style_test.rb
blob: 96c08ac3b1058dc8b40c53c1cc4e23fe0def1c0d (plain) (tree)



















































































































                                                               
require "abstract_unit"

class ApplicationController < ActionController::Base; end
class ModelsController      < ApplicationController;  end
module Admin
  class WidgetsController < ApplicationController; end
end

# ApplicationController
describe ApplicationController do
  describe "nested" do
    describe "even deeper" do
      it "exists" do
        assert_kind_of ApplicationController, @controller
      end
    end
  end
end

describe ApplicationController, :index do
  describe "nested" do
    describe "even deeper" do
      it "exists" do
        assert_kind_of ApplicationController, @controller
      end
    end
  end
end

describe ApplicationController, "unauthenticated user" do
  describe "nested" do
    describe "even deeper" do
      it "exists" do
        assert_kind_of ApplicationController, @controller
      end
    end
  end
end

# ModelsController
describe ModelsController do
  describe "nested" do
    describe "even deeper" do
      it "exists" do
        assert_kind_of ModelsController, @controller
      end
    end
  end
end

describe ModelsController, :index do
  describe "nested" do
    describe "even deeper" do
      it "exists" do
        assert_kind_of ModelsController, @controller
      end
    end
  end
end

describe ModelsController, "unauthenticated user" do
  describe "nested" do
    describe "even deeper" do
      it "exists" do
        assert_kind_of ModelsController, @controller
      end
    end
  end
end

# Nested Admin::WidgetsControllerTest
module Admin
  class WidgetsControllerTest < ActionController::TestCase
    test "exists" do
      assert_kind_of Admin::WidgetsController, @controller
    end
  end

  describe WidgetsController do
    describe "index" do
      it "respond successful" do
        assert_kind_of Admin::WidgetsController, @controller
      end
    end
  end

  describe WidgetsController, "unauthenticated users" do
    describe "index" do
      it "respond successful" do
        assert_kind_of Admin::WidgetsController, @controller
      end
    end
  end
end

class Admin::WidgetsControllerTest < ActionController::TestCase
  test "exists here too" do
    assert_kind_of Admin::WidgetsController, @controller
  end
end

describe Admin::WidgetsController do
  describe "index" do
    it "respond successful" do
      assert_kind_of Admin::WidgetsController, @controller
    end
  end
end

describe Admin::WidgetsController, "unauthenticated users" do
  describe "index" do
    it "respond successful" do
      assert_kind_of Admin::WidgetsController, @controller
    end
  end
end