From 0e2156d33431d2343dca57c54d8ccb3d558dff95 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Fri, 18 Nov 2011 11:51:05 -0500 Subject: Update variable's name in the test case to reflect the class we're testing --- .../cases/validations/exclusion_validation_test.rb | 12 +++++------ .../cases/validations/format_validation_test.rb | 24 +++++++++++----------- .../cases/validations/inclusion_validation_test.rb | 12 +++++------ 3 files changed, 24 insertions(+), 24 deletions(-) (limited to 'activemodel/test') diff --git a/activemodel/test/cases/validations/exclusion_validation_test.rb b/activemodel/test/cases/validations/exclusion_validation_test.rb index 72a383f128..adab8ccb2b 100644 --- a/activemodel/test/cases/validations/exclusion_validation_test.rb +++ b/activemodel/test/cases/validations/exclusion_validation_test.rb @@ -46,12 +46,12 @@ class ExclusionValidationTest < ActiveModel::TestCase def test_validates_exclusion_of_with_lambda Topic.validates_exclusion_of :title, :in => lambda{ |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) } - p = Topic.new - p.title = "elephant" - p.author_name = "sikachu" - assert p.invalid? + t = Topic.new + t.title = "elephant" + t.author_name = "sikachu" + assert t.invalid? - p.title = "wasabi" - assert p.valid? + t.title = "wasabi" + assert t.valid? end end diff --git a/activemodel/test/cases/validations/format_validation_test.rb b/activemodel/test/cases/validations/format_validation_test.rb index 2ce714fef0..41a1131bcb 100644 --- a/activemodel/test/cases/validations/format_validation_test.rb +++ b/activemodel/test/cases/validations/format_validation_test.rb @@ -101,25 +101,25 @@ class PresenceValidationTest < ActiveModel::TestCase def test_validates_format_of_with_lambda Topic.validates_format_of :content, :with => lambda{ |topic| topic.title == "digit" ? /\A\d+\Z/ : /\A\S+\Z/ } - p = Topic.new - p.title = "digit" - p.content = "Pixies" - assert p.invalid? + t = Topic.new + t.title = "digit" + t.content = "Pixies" + assert t.invalid? - p.content = "1234" - assert p.valid? + t.content = "1234" + assert t.valid? end def test_validates_format_of_without_lambda Topic.validates_format_of :content, :without => lambda{ |topic| topic.title == "characters" ? /\A\d+\Z/ : /\A\S+\Z/ } - p = Topic.new - p.title = "characters" - p.content = "1234" - assert p.invalid? + t = Topic.new + t.title = "characters" + t.content = "1234" + assert t.invalid? - p.content = "Pixies" - assert p.valid? + t.content = "Pixies" + assert t.valid? end def test_validates_format_of_for_ruby_class diff --git a/activemodel/test/cases/validations/inclusion_validation_test.rb b/activemodel/test/cases/validations/inclusion_validation_test.rb index 413da92de4..851d345eab 100644 --- a/activemodel/test/cases/validations/inclusion_validation_test.rb +++ b/activemodel/test/cases/validations/inclusion_validation_test.rb @@ -78,12 +78,12 @@ class InclusionValidationTest < ActiveModel::TestCase def test_validates_inclusion_of_with_lambda Topic.validates_inclusion_of :title, :in => lambda{ |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) } - p = Topic.new - p.title = "wasabi" - p.author_name = "sikachu" - assert p.invalid? + t = Topic.new + t.title = "wasabi" + t.author_name = "sikachu" + assert t.invalid? - p.title = "elephant" - assert p.valid? + t.title = "elephant" + assert t.valid? end end -- cgit v1.2.3