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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b474cea86c5251fbe5fa94d936fd2a2779948569
4
- data.tar.gz: 565396591e0ac2f14183dac43a40710c4035479a
3
+ metadata.gz: 7c24f07f103ba93494bf92b7abbe1e68690e6421
4
+ data.tar.gz: 8299844ac4c5bb1045937ad10d4302c1ae2c5f23
5
5
  SHA512:
6
- metadata.gz: eb13a6afdddc872efd5bc031ae199ecfb977af90531db1c99fa82f6c7524d03d69a5b27d81ab27cd85c0c148e5c2dc490fd7bf6d93bbd192f1cf3c6ceda49d30
7
- data.tar.gz: 3702af23b3c206160d2c46314a1fab1b8e0fdf8d887ea77d28eeb5570b8cf8553ea63330852b5210a4fd6ae732b6dfee390e9e348eee9b03031cbb4165df9d42
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 !@value.nil? && @value < 0
125
- error = "The value must be possitive for deal.\n}"
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.3
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-17 00:00:00.000000000 Z
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