aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/activerecord
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 18:50:17 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 18:50:17 +0200
commit4b6c68dfb810c836f87587a16353317d1a180805 (patch)
treebebdbb90baa5f07de0688ec255ee18b460053d18 /actionview/test/activerecord
parent66a7cfa91045e05f134efc9ac0e226e66161e2e6 (diff)
downloadrails-4b6c68dfb810c836f87587a16353317d1a180805.tar.gz
rails-4b6c68dfb810c836f87587a16353317d1a180805.tar.bz2
rails-4b6c68dfb810c836f87587a16353317d1a180805.zip
applies new string literal convention in actionview/test
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
Diffstat (limited to 'actionview/test/activerecord')
-rw-r--r--actionview/test/activerecord/controller_runtime_test.rb12
-rw-r--r--actionview/test/activerecord/debug_helper_test.rb4
-rw-r--r--actionview/test/activerecord/form_helper_activerecord_test.rb10
-rw-r--r--actionview/test/activerecord/polymorphic_routes_test.rb46
-rw-r--r--actionview/test/activerecord/relation_cache_test.rb2
-rw-r--r--actionview/test/activerecord/render_partial_with_record_identification_test.rb14
6 files changed, 44 insertions, 44 deletions
diff --git a/actionview/test/activerecord/controller_runtime_test.rb b/actionview/test/activerecord/controller_runtime_test.rb
index a61181df88..e1946194b9 100644
--- a/actionview/test/activerecord/controller_runtime_test.rb
+++ b/actionview/test/activerecord/controller_runtime_test.rb
@@ -1,8 +1,8 @@
-require 'active_record_unit'
-require 'active_record/railties/controller_runtime'
-require 'fixtures/project'
-require 'active_support/log_subscriber/test_helper'
-require 'action_controller/log_subscriber'
+require "active_record_unit"
+require "active_record/railties/controller_runtime"
+require "fixtures/project"
+require "active_support/log_subscriber/test_helper"
+require "action_controller/log_subscriber"
ActionController::Base.include(ActiveRecord::Railties::ControllerRuntime)
@@ -24,7 +24,7 @@ class ControllerRuntimeLogSubscriberTest < ActionController::TestCase
def redirect
Project.all
- redirect_to :action => 'show'
+ redirect_to :action => "show"
end
def db_after_render
diff --git a/actionview/test/activerecord/debug_helper_test.rb b/actionview/test/activerecord/debug_helper_test.rb
index ed1c08e134..69f9d5d6d6 100644
--- a/actionview/test/activerecord/debug_helper_test.rb
+++ b/actionview/test/activerecord/debug_helper_test.rb
@@ -1,5 +1,5 @@
-require 'active_record_unit'
-require 'nokogiri'
+require "active_record_unit"
+require "nokogiri"
class DebugHelperTest < ActionView::TestCase
def test_debug
diff --git a/actionview/test/activerecord/form_helper_activerecord_test.rb b/actionview/test/activerecord/form_helper_activerecord_test.rb
index 2769b97445..21c25ddbec 100644
--- a/actionview/test/activerecord/form_helper_activerecord_test.rb
+++ b/actionview/test/activerecord/form_helper_activerecord_test.rb
@@ -1,6 +1,6 @@
-require 'active_record_unit'
-require 'fixtures/project'
-require 'fixtures/developer'
+require "active_record_unit"
+require "fixtures/project"
+require "fixtures/developer"
class FormHelperActiveRecordTest < ActionView::TestCase
tests ActionView::Helpers::FormHelper
@@ -39,12 +39,12 @@ class FormHelperActiveRecordTest < ActionView::TestCase
def test_nested_fields_for_with_child_index_option_override_on_a_nested_attributes_collection_association
form_for(@developer) do |f|
- concat f.fields_for(:projects, @developer.projects.first, :child_index => 'abc') { |cf|
+ concat f.fields_for(:projects, @developer.projects.first, :child_index => "abc") { |cf|
concat cf.text_field(:name)
}
end
- expected = whole_form('/developers/123', 'edit_developer_123', 'edit_developer', :method => 'patch') do
+ expected = whole_form("/developers/123", "edit_developer_123", "edit_developer", :method => "patch") do
'<input id="developer_projects_attributes_abc_name" name="developer[projects_attributes][abc][name]" type="text" value="project #321" />' +
'<input id="developer_projects_attributes_abc_id" name="developer[projects_attributes][abc][id]" type="hidden" value="321" />'
end
diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb
index 34b2698c7f..e72488e42e 100644
--- a/actionview/test/activerecord/polymorphic_routes_test.rb
+++ b/actionview/test/activerecord/polymorphic_routes_test.rb
@@ -1,28 +1,28 @@
-require 'active_record_unit'
-require 'fixtures/project'
+require "active_record_unit"
+require "fixtures/project"
class Task < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
class Step < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
class Bid < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
class Tax < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
class Fax < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
class Series < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
class ModelDelegator
@@ -41,17 +41,17 @@ class ModelDelegate
end
def to_param
- 'overridden'
+ "overridden"
end
end
module Blog
class Post < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
class Blog < ActiveRecord::Base
- self.table_name = 'projects'
+ self.table_name = "projects"
end
def self.use_relative_model_naming?
@@ -61,7 +61,7 @@ end
class PolymorphicRoutesTest < ActionController::TestCase
include SharedTestRoutes.url_helpers
- self.default_url_options[:host] = 'example.com'
+ self.default_url_options[:host] = "example.com"
def setup
@project = Project.new
@@ -79,7 +79,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def assert_url(url, args)
host = self.class.default_url_options[:host]
- assert_equal url.sub(/http:\/\/#{host}/, ''), polymorphic_path(args)
+ assert_equal url.sub(/http:\/\/#{host}/, ""), polymorphic_path(args)
assert_equal url, polymorphic_url(args)
assert_equal url, url_for(args)
end
@@ -274,7 +274,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_with_record_and_action
with_test_routes do
- assert_equal "http://example.com/projects/new", polymorphic_url(@project, :action => 'new')
+ assert_equal "http://example.com/projects/new", polymorphic_url(@project, :action => "new")
end
end
@@ -303,14 +303,14 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_url_helper_prefixed_with_edit_with_url_options
with_test_routes do
@project.save
- assert_equal "http://example.com/projects/#{@project.id}/edit?param1=10", edit_polymorphic_url(@project, :param1 => '10')
+ assert_equal "http://example.com/projects/#{@project.id}/edit?param1=10", edit_polymorphic_url(@project, :param1 => "10")
end
end
def test_url_helper_with_url_options
with_test_routes do
@project.save
- assert_equal "http://example.com/projects/#{@project.id}?param1=10", polymorphic_url(@project, :param1 => '10')
+ assert_equal "http://example.com/projects/#{@project.id}?param1=10", polymorphic_url(@project, :param1 => "10")
end
end
@@ -324,7 +324,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_format_option_with_url_options
with_test_routes do
@project.save
- assert_equal "http://example.com/projects/#{@project.id}.pdf?param1=10", polymorphic_url(@project, :format => :pdf, :param1 => '10')
+ assert_equal "http://example.com/projects/#{@project.id}.pdf?param1=10", polymorphic_url(@project, :format => :pdf, :param1 => "10")
end
end
@@ -373,7 +373,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_new_with_array_and_namespace
with_admin_test_routes do
- assert_equal "http://example.com/admin/projects/new", polymorphic_url([:admin, @project], :action => 'new')
+ assert_equal "http://example.com/admin/projects/new", polymorphic_url([:admin, @project], :action => "new")
end
end
@@ -480,7 +480,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_polymorphic_path_accepts_options
with_test_routes do
- assert_equal "/projects/new", polymorphic_path(@project, :action => 'new')
+ assert_equal "/projects/new", polymorphic_path(@project, :action => "new")
end
end
@@ -493,7 +493,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
object_array = [:admin, @project, @task]
original_args = [object_array.dup, options.dup]
- assert_no_difference('object_array.size') { polymorphic_path(object_array, options) }
+ assert_no_difference("object_array.size") { polymorphic_path(object_array, options) }
assert_equal original_args, [object_array, options]
end
end
@@ -527,7 +527,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_with_irregular_plural_record_and_action
with_test_routes do
- assert_equal "http://example.com/taxes/new", polymorphic_url(@tax, :action => 'new')
+ assert_equal "http://example.com/taxes/new", polymorphic_url(@tax, :action => "new")
end
end
@@ -561,7 +561,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
def test_new_with_irregular_plural_array_and_namespace
with_admin_test_routes do
- assert_equal "http://example.com/admin/taxes/new", polymorphic_url([:admin, @tax], :action => 'new')
+ assert_equal "http://example.com/admin/taxes/new", polymorphic_url([:admin, @tax], :action => "new")
end
end
@@ -728,6 +728,6 @@ class PolymorphicPathRoutesTest < PolymorphicRoutesTest
def assert_url(url, args)
host = self.class.default_url_options[:host]
- assert_equal url.sub(/http:\/\/#{host}/, ''), url_for(args)
+ assert_equal url.sub(/http:\/\/#{host}/, ""), url_for(args)
end
end
diff --git a/actionview/test/activerecord/relation_cache_test.rb b/actionview/test/activerecord/relation_cache_test.rb
index 8e97417b94..970dfae784 100644
--- a/actionview/test/activerecord/relation_cache_test.rb
+++ b/actionview/test/activerecord/relation_cache_test.rb
@@ -1,4 +1,4 @@
-require 'active_record_unit'
+require "active_record_unit"
class RelationCacheTest < ActionView::TestCase
tests ActionView::Helpers::CacheHelper
diff --git a/actionview/test/activerecord/render_partial_with_record_identification_test.rb b/actionview/test/activerecord/render_partial_with_record_identification_test.rb
index 9772ebb39e..868238d2cf 100644
--- a/actionview/test/activerecord/render_partial_with_record_identification_test.rb
+++ b/actionview/test/activerecord/render_partial_with_record_identification_test.rb
@@ -1,4 +1,4 @@
-require 'active_record_unit'
+require "active_record_unit"
class RenderPartialWithRecordIdentificationController < ActionController::Base
def render_with_has_many_and_belongs_to_association
@@ -42,7 +42,7 @@ class RenderPartialWithRecordIdentificationController < ActionController::Base
def render_with_record_collection_and_spacer_template
@developer = Developer.find(1)
- render :partial => @developer.projects, :spacer_template => 'test/partial_only'
+ render :partial => @developer.projects, :spacer_template => "test/partial_only"
end
end
@@ -57,27 +57,27 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase
def test_rendering_partial_with_has_many_association
get :render_with_has_many_association
- assert_equal 'Birdman is better!', @response.body
+ assert_equal "Birdman is better!", @response.body
end
def test_rendering_partial_with_scope
get :render_with_scope
- assert_equal 'Birdman is better!Nuh uh!', @response.body
+ assert_equal "Birdman is better!Nuh uh!", @response.body
end
def test_render_with_record
get :render_with_record
- assert_equal 'David', @response.body
+ assert_equal "David", @response.body
end
def test_render_with_record_collection
get :render_with_record_collection
- assert_equal 'DavidJamisfixture_3fixture_4fixture_5fixture_6fixture_7fixture_8fixture_9fixture_10Jamis', @response.body
+ assert_equal "DavidJamisfixture_3fixture_4fixture_5fixture_6fixture_7fixture_8fixture_9fixture_10Jamis", @response.body
end
def test_render_with_record_collection_and_spacer_template
get :render_with_record_collection_and_spacer_template
- assert_equal Developer.find(1).projects.map(&:name).join('only partial'), @response.body
+ assert_equal Developer.find(1).projects.map(&:name).join("only partial"), @response.body
end
def test_rendering_partial_with_has_one_association