1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/controller/spec_style_test.rb
Mike Moore b2e5db9c71 Allow strings in the controller test describe blocks
Allow controller tests using the spec DSL to match strings.
Add test coverage for the register_spec_type calls.
2012-09-24 14:21:47 -06:00

208 lines
4.4 KiB
Ruby

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
describe "ApplicationControllerTest" do
describe "nested" do
describe "even deeper" do
it "exists" do
assert_kind_of ApplicationController, @controller
end
end
end
end
describe "ApplicationControllerTest", :index do
describe "nested" do
describe "even deeper" do
it "exists" do
assert_kind_of ApplicationController, @controller
end
end
end
end
describe "ApplicationControllerTest", "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
describe "ModelsControllerTest" do
describe "nested" do
describe "even deeper" do
it "exists" do
assert_kind_of ModelsController, @controller
end
end
end
end
describe "ModelsControllerTest", :index do
describe "nested" do
describe "even deeper" do
it "exists" do
assert_kind_of ModelsController, @controller
end
end
end
end
describe "ModelsControllerTest", "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
describe "Admin::WidgetsController" do
describe "index" do
it "respond successful" do
assert_kind_of Admin::WidgetsController, @controller
end
end
end
describe "Admin::WidgetsControllerTest" 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
describe "Admin::WidgetsControllerTest", "unauthenticated users" do
describe "index" do
it "respond successful" do
assert_kind_of Admin::WidgetsController, @controller
end
end
end