aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/app_generator_test.rb33
-rw-r--r--railties/test/generators/resource_generator_test.rb6
-rw-r--r--railties/test/generators/scaffold_controller_generator_test.rb37
3 files changed, 0 insertions, 76 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb
index 363155bc55..27960c63e9 100644
--- a/railties/test/generators/app_generator_test.rb
+++ b/railties/test/generators/app_generator_test.rb
@@ -361,39 +361,6 @@ class AppGeneratorTest < Rails::Generators::TestCase
assert_file "config/application.rb", /config\.active_record\.dependent_restrict_raises = false/
end
- def test_http_generates_config_middleware_and_generator_http_setup
- run_generator [destination_root, "--http"]
- assert_file "config/application.rb", /config\.middleware\.http_only!/,
- /config\.generators\.http_only!/
- end
-
- def test_http_generates_application_controller_with_action_controller_http
- run_generator [destination_root, "--http"]
- assert_file "app/controllers/application_controller.rb",
- /class ApplicationController < ActionController::HTTP/
- end
-
- def test_http_generates_application_controller_with_protect_from_forgery_commented_out_setup
- run_generator [destination_root, "--http"]
- assert_file "app/controllers/application_controller.rb", /^ # protect_from_forgery/
- end
-
- def test_http_does_not_generate_app_views_dir
- run_generator [destination_root, "--http"]
- assert_no_directory "app/views"
- end
-
- def test_http_skip_sprockets_entries_in_gemfile_and_application
- run_generator [destination_root, "--http"]
- assert_file "Gemfile" do |content|
- assert_no_match(/group :assets/, content)
- end
- assert_file "config/application.rb" do |content|
- assert_match(/^# require "sprockets/, content)
- assert_no_match(/config\.assets/, content)
- end
- end
-
def test_pretend_option
output = run_generator [File.join(destination_root, "myapp"), "--pretend"]
assert_no_match(/run bundle install/, output)
diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb
index 4ba3ad8c41..73804dae45 100644
--- a/railties/test/generators/resource_generator_test.rb
+++ b/railties/test/generators/resource_generator_test.rb
@@ -86,10 +86,4 @@ class ResourceGeneratorTest < Rails::Generators::TestCase
assert_no_match(/resources :accounts$/, route)
end
end
-
- def test_http_only_does_not_generate_edit_route
- run_generator ["Account", "--http"]
-
- assert_file "config/routes.rb", /resources :accounts, except: :edit$/
- end
end
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb
index ed54ce43da..1eea50b0d9 100644
--- a/railties/test/generators/scaffold_controller_generator_test.rb
+++ b/railties/test/generators/scaffold_controller_generator_test.rb
@@ -142,41 +142,4 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase
assert_match(/\{ render action: "new" \}/, content)
end
end
-
- def test_http_only_generates_controller_without_respond_to_block_and_html_format
- run_generator ["User", "--http"]
-
- assert_file "app/controllers/users_controller.rb" do |content|
- assert_match(/render json: @user/, content)
- assert_no_match(/respond_to/, content)
- assert_no_match(/format\.html/, content)
- end
- end
-
- def test_http_only_generates_functional_tests_with_json_format_and_http_status_assertions
- run_generator ["User", "--http"]
-
- assert_file "test/functional/users_controller_test.rb" do |content|
- assert_match(/class UsersControllerTest < ActionController::TestCase/, content)
- assert_match(/@request\.accept = "application\/json"/, content)
- assert_match(/test "should get index"/, content)
-
- assert_match(/assert_response 201/, content)
- assert_no_match(/assert_redirected_to/, content)
- end
- end
-
- def test_http_only_does_not_generate_edit_action
- run_generator ["User", "--http"]
-
- assert_file "app/controllers/users_controller.rb" do |content|
- assert_match(/def index/, content)
- assert_no_match(/def edit/, content)
- end
-
- assert_file "test/functional/users_controller_test.rb" do |content|
- assert_match(/test "should get index"/, content)
- assert_no_match(/test "should get edit"/, content)
- end
- end
end