move-to-go 5.0.3 → 5.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/move-to-go/model/deal.rb +3 -4
- data/spec/deal_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c24f07f103ba93494bf92b7abbe1e68690e6421
|
4
|
+
data.tar.gz: 8299844ac4c5bb1045937ad10d4302c1ae2c5f23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3567f1361e0527c9282d9fc092249e4ca4d6575abbb6a28665a1c3bb7a3d53d63a56c2fcc197a965b3d9bca679469d65e47b6f14e6dfa8830cdd8f080e3c75b2
|
7
|
+
data.tar.gz: 79cce7943560bbb9df1266dc566b064b23e009baee749eaf7cb55dc4e49d279dc73f9bc2091e3b824c65912beedb16e2235d896622203c21e627e4cd94987987
|
@@ -118,11 +118,11 @@ module MoveToGo
|
|
118
118
|
warnings = String.new
|
119
119
|
|
120
120
|
if @name.nil? || @name.empty?
|
121
|
-
error = "A name is required for deal.\n
|
121
|
+
error = "A name is required for deal.\n"
|
122
122
|
end
|
123
123
|
|
124
|
-
if
|
125
|
-
error = "The value must be
|
124
|
+
if is_integer?(@value) && @value.to_i < 0
|
125
|
+
error = "The value must be positive for deal.\n"
|
126
126
|
end
|
127
127
|
|
128
128
|
if !@status.nil? && @status.status_reference.nil?
|
@@ -144,7 +144,6 @@ module MoveToGo
|
|
144
144
|
return [error, warnings]
|
145
145
|
end
|
146
146
|
|
147
|
-
|
148
147
|
def with_status
|
149
148
|
@status = DealStatus.new if @status.nil?
|
150
149
|
yield @status
|
data/spec/deal_spec.rb
CHANGED
@@ -229,4 +229,22 @@ describe "Deal" do
|
|
229
229
|
# when, then
|
230
230
|
deal.validate[1].length.should be > 0
|
231
231
|
end
|
232
|
+
|
233
|
+
it "will not validate negative values" do
|
234
|
+
# given
|
235
|
+
deal.name = "Deal"
|
236
|
+
deal.value = -1000
|
237
|
+
|
238
|
+
# when, then
|
239
|
+
deal.validate[0].length.should be > 0
|
240
|
+
end
|
241
|
+
|
242
|
+
it "will validate positive values" do
|
243
|
+
# given
|
244
|
+
deal.name = "Deal"
|
245
|
+
deal.value = "1000"
|
246
|
+
|
247
|
+
# when, then
|
248
|
+
deal.validate[0].length.should be == 0
|
249
|
+
end
|
232
250
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: move-to-go
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petter Sandholdt
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2016-11-
|
16
|
+
date: 2016-11-24 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: iso_country_codes
|