diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2017-04-22 10:19:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-22 10:19:25 -0400 |
commit | a6a93f9ed5af5c84cf35dc03759c0b7d9d880cd2 (patch) | |
tree | e619535bbb36b8c9bb7467bc492b1599fd632e9a /railties/test | |
parent | 0541a0d5481043a9c78371446389794944daf3f0 (diff) | |
parent | 87d6cb379d8cffd3f12b2dab6248ff3e8f830307 (diff) | |
download | rails-a6a93f9ed5af5c84cf35dc03759c0b7d9d880cd2.tar.gz rails-a6a93f9ed5af5c84cf35dc03759c0b7d9d880cd2.tar.bz2 rails-a6a93f9ed5af5c84cf35dc03759c0b7d9d880cd2.zip |
Merge pull request #28829 from y-yagi/follow_up_128b804
Set to `form_with_generates_remote_forms` only when config is explicitly specified
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 32eab74190..07c6afed7f 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -725,6 +725,34 @@ module ApplicationTests assert_no_match(/data-remote/, last_response.body) end + test "form_with generates remote forms by default" do + app_file "app/models/post.rb", <<-RUBY + class Post + include ActiveModel::Model + attr_accessor :name + end + RUBY + + app_file "app/controllers/posts_controller.rb", <<-RUBY + class PostsController < ApplicationController + def index + render inline: "<%= begin; form_with(model: Post.new) {|f| f.text_field(:name)}; rescue => e; e.to_s; end %>" + end + end + RUBY + + add_to_config <<-RUBY + routes.prepend do + resources :posts + end + RUBY + + app "development" + + get "/posts" + assert_match(/data-remote/, last_response.body) + end + test "default method for update can be changed" do app_file "app/models/post.rb", <<-RUBY class Post |