reform 2.3.2 → 2.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +4 -0
  3. data/lib/reform/form/dry/new_api.rb +2 -4
  4. data/lib/reform/version.rb +1 -1
  5. data/test/call_new_api.rb +6 -6
  6. data/test/call_old_api.rb +6 -6
  7. data/test/changed_test.rb +6 -6
  8. data/test/coercion_test.rb +13 -13
  9. data/test/composition_new_api.rb +24 -24
  10. data/test/composition_old_api.rb +24 -24
  11. data/test/contract_new_api.rb +8 -8
  12. data/test/contract_old_api.rb +8 -8
  13. data/test/default_test.rb +2 -2
  14. data/test/deserialize_test.rb +8 -8
  15. data/test/errors_new_api.rb +38 -38
  16. data/test/errors_old_api.rb +38 -38
  17. data/test/feature_test.rb +2 -2
  18. data/test/form_new_api.rb +3 -3
  19. data/test/form_old_api.rb +3 -3
  20. data/test/form_option_new_api.rb +1 -1
  21. data/test/form_option_old_api.rb +1 -1
  22. data/test/from_test.rb +10 -10
  23. data/test/inherit_new_api.rb +17 -17
  24. data/test/inherit_old_api.rb +17 -17
  25. data/test/module_new_api.rb +8 -8
  26. data/test/module_old_api.rb +9 -9
  27. data/test/parse_option_test.rb +7 -7
  28. data/test/parse_pipeline_test.rb +1 -1
  29. data/test/populate_new_api.rb +53 -53
  30. data/test/populate_old_api.rb +53 -53
  31. data/test/populator_skip_test.rb +2 -2
  32. data/test/prepopulator_test.rb +15 -15
  33. data/test/read_only_test.rb +2 -2
  34. data/test/readable_test.rb +3 -3
  35. data/test/reform_new_api.rb +19 -19
  36. data/test/reform_old_api.rb +19 -19
  37. data/test/save_new_api.rb +4 -4
  38. data/test/save_old_api.rb +4 -4
  39. data/test/setup_test.rb +9 -9
  40. data/test/skip_if_new_api.rb +12 -12
  41. data/test/skip_if_old_api.rb +15 -15
  42. data/test/skip_setter_and_getter_test.rb +6 -6
  43. data/test/validate_new_api.rb +62 -62
  44. data/test/validate_old_api.rb +64 -64
  45. data/test/validation/dry_validation_new_api.rb +115 -116
  46. data/test/validation/dry_validation_old_api.rb +105 -105
  47. data/test/validation/result_test.rb +14 -14
  48. data/test/virtual_test.rb +7 -7
  49. data/test/writeable_test.rb +8 -8
  50. metadata +2 -2
@@ -16,7 +16,7 @@ class DefaultTest < Minitest::Spec
16
16
  it do
17
17
  form = AlbumForm.new(Album.new(nil, [Song.new]))
18
18
 
19
- form.name.must_equal "Wrong"
20
- form.songs[0].title.must_equal "It's Catching Up"
19
+ _(form.name).must_equal "Wrong"
20
+ _(form.songs[0].title).must_equal "It's Catching Up"
21
21
  end
22
22
  end
@@ -41,9 +41,9 @@ class DeserializeTest < MiniTest::Spec
41
41
 
42
42
  form.validate(json)
43
43
 
44
- form.title.must_equal "Apocalypse Soon"
45
- form.artist.name.must_equal "Mute"
46
- form.artist.model.object_id.must_equal artist_id
44
+ _(form.title).must_equal "Apocalypse Soon"
45
+ _(form.artist.name).must_equal "Mute"
46
+ _(form.artist.model.object_id).must_equal artist_id
47
47
  end
48
48
 
49
49
  describe "infering the deserializer from another form should NOT copy its populators" do
@@ -62,7 +62,7 @@ class DeserializeTest < MiniTest::Spec
62
62
  form = CompilationForm.new(Album.new)
63
63
  form.validate("artist" => {"name" => "Horowitz"}) # the deserializer doesn't know symbols.
64
64
  form.sync
65
- form.artist.model.must_equal Artist.new("Horowitz", %{{"name"=>"Horowitz"}})
65
+ _(form.artist.model).must_equal Artist.new("Horowitz", %{{"name"=>"Horowitz"}})
66
66
  end
67
67
  end
68
68
  end
@@ -91,11 +91,11 @@ class ValidateWithBlockTest < MiniTest::Spec
91
91
  options_from: :deserializer
92
92
  )
93
93
 
94
- form.validate(json) { |params|
94
+ _(form.validate(json) { |params|
95
95
  deserializer.new(form).from_json(params)
96
- }.must_equal true # with block must return result, too.
96
+ }).must_equal true # with block must return result, too.
97
97
 
98
- form.title.must_equal "Apocalypse Soon"
99
- form.artist.name.must_equal "Mute"
98
+ _(form.title).must_equal "Apocalypse Soon"
99
+ _(form.artist.name).must_equal "Mute"
100
100
  end
101
101
  end
@@ -72,22 +72,22 @@ class ErrorsTest < MiniTest::Spec
72
72
 
73
73
  describe "#validate with invalid array property" do
74
74
  it do
75
- form.validate(
75
+ _(form.validate(
76
76
  title: "Swimming Pool - EP",
77
77
  band: {
78
78
  name: "Marie Madeleine",
79
79
  label: {name: "Ekler'o'shocK"}
80
80
  },
81
81
  artists: [42, "Good Charlotte", 43]
82
- ).must_equal false
83
- form.errors.messages.must_equal(artists: {0 => ["must be a string"], 2 => ["must be a string"]})
84
- form.errors.size.must_equal(1)
82
+ )).must_equal false
83
+ _(form.errors.messages).must_equal(artists: {0 => ["must be a string"], 2 => ["must be a string"]})
84
+ _(form.errors.size).must_equal(1)
85
85
  end
86
86
  end
87
87
 
88
88
  describe "#errors without #validate" do
89
89
  it do
90
- form.errors.size.must_equal 0
90
+ _(form.errors.size).must_equal 0
91
91
  end
92
92
  end
93
93
 
@@ -102,7 +102,7 @@ class ErrorsTest < MiniTest::Spec
102
102
  end
103
103
 
104
104
  it do
105
- form.errors.messages.must_equal(
105
+ _(form.errors.messages).must_equal(
106
106
  title: ["must be filled"],
107
107
  "hit.title": ["must be filled"],
108
108
  "songs.title": ["must be filled"],
@@ -117,60 +117,60 @@ class ErrorsTest < MiniTest::Spec
117
117
  # end
118
118
 
119
119
  # nested forms keep their own Errors:
120
- it { form.producer.errors.messages.must_equal(name: ["must be filled"]) }
121
- it { form.hit.errors.messages.must_equal(title: ["must be filled"]) }
122
- it { form.songs[0].errors.messages.must_equal(title: ["must be filled"]) }
120
+ it { _(form.producer.errors.messages).must_equal(name: ["must be filled"]) }
121
+ it { _(form.hit.errors.messages).must_equal(title: ["must be filled"]) }
122
+ it { _(form.songs[0].errors.messages).must_equal(title: ["must be filled"]) }
123
123
 
124
124
  it do
125
- form.errors.messages.must_equal(
125
+ _(form.errors.messages).must_equal(
126
126
  title: ["must be filled"],
127
127
  "hit.title": ["must be filled"],
128
128
  "songs.title": ["must be filled"],
129
129
  "band.label.name": ["must be filled"],
130
130
  "producer.name": ["must be filled"]
131
131
  )
132
- form.errors.size.must_equal(5)
132
+ _(form.errors.size).must_equal(5)
133
133
  end
134
134
  end
135
135
 
136
136
  describe "#validate with main form invalid" do
137
137
  it do
138
- form.validate("title" => "", "band" => {"label" => {name: "Fat Wreck"}}, "producer" => nil).must_equal false
139
- form.errors.messages.must_equal(title: ["must be filled"], producer: ["must be a hash"])
140
- form.errors.size.must_equal(2)
138
+ _(form.validate("title" => "", "band" => {"label" => {name: "Fat Wreck"}}, "producer" => nil)).must_equal false
139
+ _(form.errors.messages).must_equal(title: ["must be filled"], producer: ["must be a hash"])
140
+ _(form.errors.size).must_equal(2)
141
141
  end
142
142
  end
143
143
 
144
144
  describe "#validate with middle nested form invalid" do
145
145
  before { @result = form.validate("hit" => {"title" => ""}, "band" => {"label" => {name: "Fat Wreck"}}) }
146
146
 
147
- it { @result.must_equal false }
148
- it { form.errors.messages.must_equal("hit.title": ["must be filled"]) }
149
- it { form.errors.size.must_equal(1) }
147
+ it { _(@result).must_equal false }
148
+ it { _(form.errors.messages).must_equal("hit.title": ["must be filled"]) }
149
+ it { _(form.errors.size).must_equal(1) }
150
150
  end
151
151
 
152
152
  describe "#validate with collection form invalid" do
153
153
  before { @result = form.validate("songs" => [{"title" => ""}], "band" => {"label" => {name: "Fat Wreck"}}) }
154
154
 
155
- it { @result.must_equal false }
156
- it { form.errors.messages.must_equal("songs.title": ["must be filled"]) }
157
- it { form.errors.size.must_equal(1) }
155
+ it { _(@result).must_equal false }
156
+ it { _(form.errors.messages).must_equal("songs.title": ["must be filled"]) }
157
+ it { _(form.errors.size).must_equal(1) }
158
158
  end
159
159
 
160
160
  describe "#validate with collection and 2-level-nested invalid" do
161
161
  before { @result = form.validate("songs" => [{"title" => ""}], "band" => {"label" => {}}) }
162
162
 
163
- it { @result.must_equal false }
164
- it { form.errors.messages.must_equal("songs.title": ["must be filled"], "band.label.name": ["must be filled"]) }
165
- it { form.errors.size.must_equal(2) }
163
+ it { _(@result).must_equal false }
164
+ it { _(form.errors.messages).must_equal("songs.title": ["must be filled"], "band.label.name": ["must be filled"]) }
165
+ it { _(form.errors.size).must_equal(2) }
166
166
  end
167
167
 
168
168
  describe "#validate with nested form using :base invalid" do
169
169
  it do
170
170
  result = form.validate("songs" => [{"title" => "Someday"}], "band" => {"name" => "Nickelback", "label" => {"name" => "Roadrunner Records"}})
171
- result.must_equal false
172
- form.errors.messages.must_equal("band.name": ["you're a bad person"])
173
- form.errors.size.must_equal(1)
171
+ _(result).must_equal false
172
+ _(form.errors.messages).must_equal("band.name": ["you're a bad person"])
173
+ _(form.errors.size).must_equal(1)
174
174
  end
175
175
  end
176
176
 
@@ -178,17 +178,17 @@ class ErrorsTest < MiniTest::Spec
178
178
  let(:album_title) { nil }
179
179
  it do
180
180
  result = form.validate("songs" => [{"title" => "Someday"}], "band" => {"name" => "Nickelback", "label" => {"name" => "Roadrunner Records"}})
181
- result.must_equal false
182
- form.errors.messages.must_equal(title: ["must be filled"], "band.name": ["you're a bad person"])
181
+ _(result).must_equal false
182
+ _(form.errors.messages).must_equal(title: ["must be filled"], "band.name": ["you're a bad person"])
183
183
  # add a new custom error
184
184
  form.errors.add(:policy, "error_text")
185
- form.errors.messages.must_equal(title: ["must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
185
+ _(form.errors.messages).must_equal(title: ["must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
186
186
  # does not duplicate errors
187
187
  form.errors.add(:title, "must be filled")
188
- form.errors.messages.must_equal(title: ["must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
188
+ _(form.errors.messages).must_equal(title: ["must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
189
189
  # merge existing errors
190
190
  form.errors.add(:policy, "another error")
191
- form.errors.messages.must_equal(title: ["must be filled"], "band.name": ["you're a bad person"], policy: ["error_text", "another error"])
191
+ _(form.errors.messages).must_equal(title: ["must be filled"], "band.name": ["you're a bad person"], policy: ["error_text", "another error"])
192
192
  end
193
193
  end
194
194
 
@@ -202,14 +202,14 @@ class ErrorsTest < MiniTest::Spec
202
202
  )
203
203
  end
204
204
 
205
- it { @result.must_equal true }
206
- it { form.hit.title.must_equal "Sacrifice" }
207
- it { form.title.must_equal "Second Heat" }
208
- it { form.songs.first.title.must_equal "Heart Of A Lion" }
205
+ it { _(@result).must_equal true }
206
+ it { _(form.hit.title).must_equal "Sacrifice" }
207
+ it { _(form.title).must_equal "Second Heat" }
208
+ it { _(form.songs.first.title).must_equal "Heart Of A Lion" }
209
209
  it do
210
210
  skip "WE DON'T NEED COUNT AND EMPTY? ON THE CORE ERRORS OBJECT"
211
- form.errors.size.must_equal(0)
212
- form.errors.empty?.must_equal(true)
211
+ _(form.errors.size).must_equal(0)
212
+ _(form.errors.empty?).must_equal(true)
213
213
  end
214
214
  end
215
215
 
@@ -219,7 +219,7 @@ class ErrorsTest < MiniTest::Spec
219
219
  # to_s is aliased to messages
220
220
  it {
221
221
  skip "why do we need Errors#to_s ?"
222
- form.errors.to_s.must_equal "{:\"songs.title\"=>[\"must be filled\"], :\"band.label.name\"=>[\"must be filled\"]}"
222
+ _(form.errors.to_s).must_equal "{:\"songs.title\"=>[\"must be filled\"], :\"band.label.name\"=>[\"must be filled\"]}"
223
223
  }
224
224
  end
225
225
  end
@@ -74,22 +74,22 @@ class ErrorsTest < MiniTest::Spec
74
74
 
75
75
  describe "#validate with invalid array property" do
76
76
  it do
77
- form.validate(
77
+ _(form.validate(
78
78
  title: "Swimming Pool - EP",
79
79
  band: {
80
80
  name: "Marie Madeleine",
81
81
  label: {name: "Ekler'o'shocK"}
82
82
  },
83
83
  artists: [42, "Good Charlotte", 43]
84
- ).must_equal false
85
- form.errors.messages.must_equal(artists: {0 => ["must be a string"], 2 => ["must be a string"]})
86
- form.errors.size.must_equal(1)
84
+ )).must_equal false
85
+ _(form.errors.messages).must_equal(artists: {0 => ["must be a string"], 2 => ["must be a string"]})
86
+ _(form.errors.size).must_equal(1)
87
87
  end
88
88
  end
89
89
 
90
90
  describe "#errors without #validate" do
91
91
  it do
92
- form.errors.size.must_equal 0
92
+ _(form.errors.size).must_equal 0
93
93
  end
94
94
  end
95
95
 
@@ -104,7 +104,7 @@ class ErrorsTest < MiniTest::Spec
104
104
  end
105
105
 
106
106
  it do
107
- form.errors.messages.must_equal(
107
+ _(form.errors.messages).must_equal(
108
108
  title: ["must be filled"],
109
109
  "hit.title": ["must be filled"],
110
110
  "songs.title": ["must be filled"],
@@ -119,60 +119,60 @@ class ErrorsTest < MiniTest::Spec
119
119
  # end
120
120
 
121
121
  # nested forms keep their own Errors:
122
- it { form.producer.errors.messages.must_equal(name: ["must be filled"]) }
123
- it { form.hit.errors.messages.must_equal(title: ["must be filled"]) }
124
- it { form.songs[0].errors.messages.must_equal(title: ["must be filled"]) }
122
+ it { _(form.producer.errors.messages).must_equal(name: ["must be filled"]) }
123
+ it { _(form.hit.errors.messages).must_equal(title: ["must be filled"]) }
124
+ it { _(form.songs[0].errors.messages).must_equal(title: ["must be filled"]) }
125
125
 
126
126
  it do
127
- form.errors.messages.must_equal(
127
+ _(form.errors.messages).must_equal(
128
128
  title: ["must be filled"],
129
129
  "hit.title": ["must be filled"],
130
130
  "songs.title": ["must be filled"],
131
131
  "band.label.name": ["must be filled"],
132
132
  "producer.name": ["must be filled"]
133
133
  )
134
- form.errors.size.must_equal(5)
134
+ _(form.errors.size).must_equal(5)
135
135
  end
136
136
  end
137
137
 
138
138
  describe "#validate with main form invalid" do
139
139
  it do
140
- form.validate("title" => "", "band" => {"label" => {name: "Fat Wreck"}}, "producer" => nil).must_equal false
141
- form.errors.messages.must_equal(title: ["must be filled"], producer: ["must be a hash"])
142
- form.errors.size.must_equal(2)
140
+ _(form.validate("title" => "", "band" => {"label" => {name: "Fat Wreck"}}, "producer" => nil)).must_equal false
141
+ _(form.errors.messages).must_equal(title: ["must be filled"], producer: ["must be a hash"])
142
+ _(form.errors.size).must_equal(2)
143
143
  end
144
144
  end
145
145
 
146
146
  describe "#validate with middle nested form invalid" do
147
147
  before { @result = form.validate("hit" => {"title" => ""}, "band" => {"label" => {name: "Fat Wreck"}}) }
148
148
 
149
- it { @result.must_equal false }
150
- it { form.errors.messages.must_equal("hit.title": ["must be filled"]) }
151
- it { form.errors.size.must_equal(1) }
149
+ it { _(@result).must_equal false }
150
+ it { _(form.errors.messages).must_equal("hit.title": ["must be filled"]) }
151
+ it { _(form.errors.size).must_equal(1) }
152
152
  end
153
153
 
154
154
  describe "#validate with collection form invalid" do
155
155
  before { @result = form.validate("songs" => [{"title" => ""}], "band" => {"label" => {name: "Fat Wreck"}}) }
156
156
 
157
- it { @result.must_equal false }
158
- it { form.errors.messages.must_equal("songs.title": ["must be filled"]) }
159
- it { form.errors.size.must_equal(1) }
157
+ it { _(@result).must_equal false }
158
+ it { _(form.errors.messages).must_equal("songs.title": ["must be filled"]) }
159
+ it { _(form.errors.size).must_equal(1) }
160
160
  end
161
161
 
162
162
  describe "#validate with collection and 2-level-nested invalid" do
163
163
  before { @result = form.validate("songs" => [{"title" => ""}], "band" => {"label" => {}}) }
164
164
 
165
- it { @result.must_equal false }
166
- it { form.errors.messages.must_equal("songs.title": ["must be filled"], "band.label.name": ["must be filled"]) }
167
- it { form.errors.size.must_equal(2) }
165
+ it { _(@result).must_equal false }
166
+ it { _(form.errors.messages).must_equal("songs.title": ["must be filled"], "band.label.name": ["must be filled"]) }
167
+ it { _(form.errors.size).must_equal(2) }
168
168
  end
169
169
 
170
170
  describe "#validate with nested form using :base invalid" do
171
171
  it do
172
172
  result = form.validate("songs" => [{"title" => "Someday"}], "band" => {"name" => "Nickelback", "label" => {"name" => "Roadrunner Records"}})
173
- result.must_equal false
174
- form.errors.messages.must_equal("band.name": ["you're a bad person"])
175
- form.errors.size.must_equal(1)
173
+ _(result).must_equal false
174
+ _(form.errors.messages).must_equal("band.name": ["you're a bad person"])
175
+ _(form.errors.size).must_equal(1)
176
176
  end
177
177
  end
178
178
 
@@ -183,17 +183,17 @@ class ErrorsTest < MiniTest::Spec
183
183
  form.errors.add(:before, "validate 2")
184
184
  form.errors.add(:title, "before validate")
185
185
  result = form.validate("songs" => [{"title" => "Someday"}], "band" => {"name" => "Nickelback", "label" => {"name" => "Roadrunner Records"}})
186
- result.must_equal false
187
- form.errors.messages.must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"])
186
+ _(result).must_equal false
187
+ _(form.errors.messages).must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"])
188
188
  # add a new custom error
189
189
  form.errors.add(:policy, "error_text")
190
- form.errors.messages.must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
190
+ _(form.errors.messages).must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
191
191
  # does not duplicate errors
192
192
  form.errors.add(:title, "must be filled")
193
- form.errors.messages.must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
193
+ _(form.errors.messages).must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"], policy: ["error_text"])
194
194
  # merge existing errors
195
195
  form.errors.add(:policy, "another error")
196
- form.errors.messages.must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"], policy: ["error_text", "another error"])
196
+ _(form.errors.messages).must_equal(before: ["validate", "validate 2"], title: ["before validate", "must be filled"], "band.name": ["you're a bad person"], policy: ["error_text", "another error"])
197
197
  end
198
198
  end
199
199
 
@@ -207,14 +207,14 @@ class ErrorsTest < MiniTest::Spec
207
207
  )
208
208
  end
209
209
 
210
- it { @result.must_equal true }
211
- it { form.hit.title.must_equal "Sacrifice" }
212
- it { form.title.must_equal "Second Heat" }
213
- it { form.songs.first.title.must_equal "Heart Of A Lion" }
210
+ it { _(@result).must_equal true }
211
+ it { _(form.hit.title).must_equal "Sacrifice" }
212
+ it { _(form.title).must_equal "Second Heat" }
213
+ it { _(form.songs.first.title).must_equal "Heart Of A Lion" }
214
214
  it do
215
215
  skip "WE DON'T NEED COUNT AND EMPTY? ON THE CORE ERRORS OBJECT"
216
- form.errors.size.must_equal(0)
217
- form.errors.empty?.must_equal(true)
216
+ _(form.errors.size).must_equal(0)
217
+ _(form.errors.empty?).must_equal(true)
218
218
  end
219
219
  end
220
220
 
@@ -224,7 +224,7 @@ class ErrorsTest < MiniTest::Spec
224
224
  # to_s is aliased to messages
225
225
  it {
226
226
  skip "why do we need Errors#to_s ?"
227
- form.errors.to_s.must_equal "{:\"songs.title\"=>[\"must be filled\"], :\"band.label.name\"=>[\"must be filled\"]}"
227
+ _(form.errors.to_s).must_equal "{:\"songs.title\"=>[\"must be filled\"], :\"band.label.name\"=>[\"must be filled\"]}"
228
228
  }
229
229
  end
230
230
  end
@@ -45,8 +45,8 @@ class FeatureInheritanceTest < BaseTest
45
45
  let(:form) { AlbumForm.new(album) }
46
46
 
47
47
  it do
48
- form.date.must_equal "May 16"
49
- form.songs[0].date.must_equal "May 16"
48
+ _(form.date).must_equal "May 16"
49
+ _(form.songs[0].date).must_equal "May 16"
50
50
  end
51
51
 
52
52
  # it { subject.class.include?(Reform::Form::ActiveModel) }
@@ -25,8 +25,8 @@ class FormTest < MiniTest::Spec
25
25
  let(:cloned) { AlbumForm.clone }
26
26
 
27
27
  # #dup is called in Op.inheritable_attr(:contract_class), it must be subclass of the original one.
28
- it { cloned.wont_equal AlbumForm }
29
- it { AlbumForm.definitions.wont_equal cloned.definitions }
28
+ it { _(cloned).wont_equal AlbumForm }
29
+ it { _(AlbumForm.definitions).wont_equal cloned.definitions }
30
30
 
31
31
  it do
32
32
  # currently, forms need a name for validation, even without AM.
@@ -51,7 +51,7 @@ class FormTest < MiniTest::Spec
51
51
  end
52
52
 
53
53
  it "allows injecting :virtual options" do
54
- ArtistForm.new(Artist.new, current_user: Object).current_user.must_equal Object
54
+ _(ArtistForm.new(Artist.new, current_user: Object).current_user).must_equal Object
55
55
  end
56
56
  end
57
57
  end
@@ -25,8 +25,8 @@ class FormTest < MiniTest::Spec
25
25
  let(:cloned) { AlbumForm.clone }
26
26
 
27
27
  # #dup is called in Op.inheritable_attr(:contract_class), it must be subclass of the original one.
28
- it { cloned.wont_equal AlbumForm }
29
- it { AlbumForm.definitions.wont_equal cloned.definitions }
28
+ it { _(cloned).wont_equal AlbumForm }
29
+ it { _(AlbumForm.definitions).wont_equal cloned.definitions }
30
30
 
31
31
  it do
32
32
  # currently, forms need a name for validation, even without AM.
@@ -51,7 +51,7 @@ class FormTest < MiniTest::Spec
51
51
  end
52
52
 
53
53
  it "allows injecting :virtual options" do
54
- ArtistForm.new(Artist.new, current_user: Object).current_user.must_equal Object
54
+ _(ArtistForm.new(Artist.new, current_user: Object).current_user).must_equal Object
55
55
  end
56
56
  end
57
57
  end
@@ -17,7 +17,7 @@ class FormOptionTest < MiniTest::Spec
17
17
 
18
18
  it do
19
19
  form = AlbumForm.new(Album.new(Song.new("When It Comes To You")))
20
- form.song.title.must_equal "When It Comes To You"
20
+ _(form.song.title).must_equal "When It Comes To You"
21
21
 
22
22
  form.validate(song: {title: "Run For Cover"})
23
23
  end
@@ -17,7 +17,7 @@ class FormOptionTest < MiniTest::Spec
17
17
 
18
18
  it do
19
19
  form = AlbumForm.new(Album.new(Song.new("When It Comes To You")))
20
- form.song.title.must_equal "When It Comes To You"
20
+ _(form.song.title).must_equal "When It Comes To You"
21
21
 
22
22
  form.validate(song: {title: "Run For Cover"})
23
23
  end