Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update variable's name in the test case to reflect the class we're te…

…sting
  • Loading branch information...
commit fc44737457f489b5a06b96d66c61246a38fa6aa7 1 parent 1b527d7
Prem Sichanugrist authored
12 activemodel/test/cases/validations/exclusion_validation_test.rb
@@ -46,12 +46,12 @@ def test_validates_exclusion_of_for_ruby_class
46 46 def test_validates_exclusion_of_with_lambda
47 47 Topic.validates_exclusion_of :title, :in => lambda{ |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) }
48 48
49   - p = Topic.new
50   - p.title = "elephant"
51   - p.author_name = "sikachu"
52   - assert p.invalid?
  49 + t = Topic.new
  50 + t.title = "elephant"
  51 + t.author_name = "sikachu"
  52 + assert t.invalid?
53 53
54   - p.title = "wasabi"
55   - assert p.valid?
  54 + t.title = "wasabi"
  55 + assert t.valid?
56 56 end
57 57 end
24 activemodel/test/cases/validations/format_validation_test.rb
@@ -101,25 +101,25 @@ def test_validates_format_of_when_not_isnt_a_regexp_should_raise_error
101 101 def test_validates_format_of_with_lambda
102 102 Topic.validates_format_of :content, :with => lambda{ |topic| topic.title == "digit" ? /\A\d+\Z/ : /\A\S+\Z/ }
103 103
104   - p = Topic.new
105   - p.title = "digit"
106   - p.content = "Pixies"
107   - assert p.invalid?
  104 + t = Topic.new
  105 + t.title = "digit"
  106 + t.content = "Pixies"
  107 + assert t.invalid?
108 108
109   - p.content = "1234"
110   - assert p.valid?
  109 + t.content = "1234"
  110 + assert t.valid?
111 111 end
112 112
113 113 def test_validates_format_of_without_lambda
114 114 Topic.validates_format_of :content, :without => lambda{ |topic| topic.title == "characters" ? /\A\d+\Z/ : /\A\S+\Z/ }
115 115
116   - p = Topic.new
117   - p.title = "characters"
118   - p.content = "1234"
119   - assert p.invalid?
  116 + t = Topic.new
  117 + t.title = "characters"
  118 + t.content = "1234"
  119 + assert t.invalid?
120 120
121   - p.content = "Pixies"
122   - assert p.valid?
  121 + t.content = "Pixies"
  122 + assert t.valid?
123 123 end
124 124
125 125 def test_validates_format_of_for_ruby_class
12 activemodel/test/cases/validations/inclusion_validation_test.rb
@@ -78,12 +78,12 @@ def test_validates_inclusion_of_for_ruby_class
78 78 def test_validates_inclusion_of_with_lambda
79 79 Topic.validates_inclusion_of :title, :in => lambda{ |topic| topic.author_name == "sikachu" ? %w( monkey elephant ) : %w( abe wasabi ) }
80 80
81   - p = Topic.new
82   - p.title = "wasabi"
83   - p.author_name = "sikachu"
84   - assert p.invalid?
  81 + t = Topic.new
  82 + t.title = "wasabi"
  83 + t.author_name = "sikachu"
  84 + assert t.invalid?
85 85
86   - p.title = "elephant"
87   - assert p.valid?
  86 + t.title = "elephant"
  87 + assert t.valid?
88 88 end
89 89 end

0 comments on commit fc44737

Please sign in to comment.
Something went wrong with that request. Please try again.