aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/railties/engine_test.rb
diff options
context:
space:
mode:
authorRobin Dupret <robin.dupret@gmail.com>2012-10-14 12:03:39 +0200
committerRobin Dupret <robin.dupret@gmail.com>2012-10-14 18:26:58 +0200
commit5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3 (patch)
tree9e58227af8a363398a03b8010156d5a84d59dea9 /railties/test/railties/engine_test.rb
parentca618d473dcb9b5cc4000d057df9322376900622 (diff)
downloadrails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.gz
rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.tar.bz2
rails-5ad7f8ab418f0c760dbb584f7c78d94ce32e9ee3.zip
Use Ruby 1.9 Hash syntax in railties
Diffstat (limited to 'railties/test/railties/engine_test.rb')
-rw-r--r--railties/test/railties/engine_test.rb42
1 files changed, 21 insertions, 21 deletions
diff --git a/railties/test/railties/engine_test.rb b/railties/test/railties/engine_test.rb
index e52b3efdab..71bb34faf5 100644
--- a/railties/test/railties/engine_test.rb
+++ b/railties/test/railties/engine_test.rb
@@ -285,8 +285,8 @@ module RailtiesTest
@plugin.write "config/routes.rb", <<-RUBY
Rails.application.routes.draw do
- get 'foo', :to => 'bar#index'
- get 'bar', :to => 'bar#index'
+ get 'foo', to: 'bar#index'
+ get 'bar', to: 'bar#index'
end
RUBY
@@ -366,7 +366,7 @@ YAML
Rails.application.routes.draw do
namespace :admin do
namespace :foo do
- get "bar", :to => "bar#index"
+ get "bar", to: "bar#index"
end
end
end
@@ -375,7 +375,7 @@ YAML
@plugin.write "app/controllers/admin/foo/bar_controller.rb", <<-RUBY
class Admin::Foo::BarController < ApplicationController
def index
- render :text => "Rendered from namespace"
+ render text: "Rendered from namespace"
end
end
RUBY
@@ -487,14 +487,14 @@ YAML
controller "foo", <<-RUBY
class FooController < ActionController::Base
def index
- render :text => params[:username]
+ render text: params[:username]
end
end
RUBY
@plugin.write "config/routes.rb", <<-RUBY
Bukkits::Engine.routes.draw do
- root :to => "foo#index"
+ root to: "foo#index"
end
RUBY
@@ -608,14 +608,14 @@ YAML
app_file "config/routes.rb", <<-RUBY
AppTemplate::Application.routes.draw do
- get "/bar" => "bar#index", :as => "bar"
- mount Bukkits::Engine => "/bukkits", :as => "bukkits"
+ get "/bar" => "bar#index", as: "bar"
+ mount Bukkits::Engine => "/bukkits", as: "bukkits"
end
RUBY
@plugin.write "config/routes.rb", <<-RUBY
Bukkits::Engine.routes.draw do
- get "/foo" => "foo#index", :as => "foo"
+ get "/foo" => "foo#index", as: "foo"
get "/foo/show" => "foo#show"
get "/from_app" => "foo#from_app"
get "/routes_helpers_in_view" => "foo#routes_helpers_in_view"
@@ -643,23 +643,23 @@ YAML
@plugin.write "app/controllers/bukkits/foo_controller.rb", <<-RUBY
class Bukkits::FooController < ActionController::Base
def index
- render :inline => "<%= help_the_engine %>"
+ render inline: "<%= help_the_engine %>"
end
def show
- render :text => foo_path
+ render text: foo_path
end
def from_app
- render :inline => "<%= (self.respond_to?(:bar_path) || self.respond_to?(:something)) %>"
+ render inline: "<%= (self.respond_to?(:bar_path) || self.respond_to?(:something)) %>"
end
def routes_helpers_in_view
- render :inline => "<%= foo_path %>, <%= main_app.bar_path %>"
+ render :inline "<%= foo_path %>, <%= main_app.bar_path %>"
end
def polymorphic_path_without_namespace
- render :text => polymorphic_path(Post.new)
+ render text: polymorphic_path(Post.new)
end
end
RUBY
@@ -726,7 +726,7 @@ YAML
app_file "config/routes.rb", <<-RUBY
AppTemplate::Application.routes.draw do
- mount Bukkits::Engine => "/bukkits", :as => "bukkits"
+ mount Bukkits::Engine => "/bukkits", as: "bukkits"
end
RUBY
@@ -1033,11 +1033,11 @@ YAML
controller "main", <<-RUBY
class MainController < ActionController::Base
def foo
- render :inline => '<%= render :partial => "shared/foo" %>'
+ render inline: '<%= render :partial => "shared/foo" %>'
end
def bar
- render :inline => '<%= render :partial => "shared/bar" %>'
+ render inline: '<%= render :partial => "shared/bar" %>'
end
end
RUBY
@@ -1113,7 +1113,7 @@ YAML
controller "main", <<-RUBY
class MainController < ActionController::Base
def foo
- render :inline => '<%= render :partial => "shared/foo" %>'
+ render inline: '<%= render :partial => "shared/foo" %>'
end
end
RUBY
@@ -1167,7 +1167,7 @@ YAML
fullpath: \#{request.fullpath}
path: \#{request.path}
TEXT
- render :text => text
+ render text: text
end
end
end
@@ -1205,7 +1205,7 @@ YAML
app_file "app/controllers/bar_controller.rb", <<-RUBY
class BarController < ApplicationController
def index
- render :text => bukkits.bukkit_path
+ render text: bukkits.bukkit_path
end
end
RUBY
@@ -1227,7 +1227,7 @@ YAML
@plugin.write "app/controllers/bukkits/bukkit_controller.rb", <<-RUBY
class Bukkits::BukkitController < ActionController::Base
def index
- render :text => main_app.bar_path
+ render text: main_app.bar_path
end
end
RUBY