smartkiosk-server 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -24,7 +24,7 @@ gem 'redis-objects', :require => 'redis/objects'
24
24
  gem 'redis-objects-rmap'
25
25
  gem 'active_attr'
26
26
 
27
- gem 'payzilla', '0.0.2'
27
+ gem 'payzilla', '0.0.4'
28
28
 
29
29
  gem 'haml'
30
30
  gem 'coffee-filter'
@@ -219,7 +219,7 @@ GEM
219
219
  paper_trail (2.7.0)
220
220
  activerecord (~> 3.0)
221
221
  railties (~> 3.0)
222
- payzilla (0.0.2)
222
+ payzilla (0.0.4)
223
223
  crack
224
224
  cyberplat_pki
225
225
  gpgme-ffi
@@ -406,7 +406,7 @@ DEPENDENCIES
406
406
  meta_search (>= 1.1.0)
407
407
  money
408
408
  paper_trail
409
- payzilla (= 0.0.2)
409
+ payzilla (= 0.0.4)
410
410
  pg
411
411
  pry
412
412
  rails (= 3.2.11)
@@ -1,5 +1,5 @@
1
1
  module Smartkiosk
2
2
  module Server
3
- VERSION = '0.10.1'
3
+ VERSION = '0.10.2'
4
4
  end
5
5
  end
@@ -19,13 +19,72 @@ describe TerminalPingsController do
19
19
  :cash_acceptor => {
20
20
  'error' => '-1'
21
21
  },
22
- :providers => {
23
- :updated_at => DateTime.now,
24
- :ids => [1, 2, 3]
25
- }
22
+ :providers_updated_at => DateTime.now,
26
23
  }
27
- @terminal.pings.count.should == 1
24
+ @terminal.pings.count.should >= 1
28
25
  @terminal.pings.first.cash_sum.should == 1140
29
26
  @terminal.pings.first.ip.should == '127.0.0.1'
30
27
  end
28
+
29
+ it "updates outdated providers" do
30
+ post :create, :terminal => 'test', :terminal_ping => {
31
+ :providers_updated_at => nil
32
+ }
33
+
34
+ body = ActiveSupport::JSON.decode response.body
35
+ body["update_providers"].should == true
36
+ end
37
+
38
+ it "properly handles actual providers" do
39
+ post :create, :terminal => 'test', :terminal_ping => {
40
+ :providers_updated_at => DateTime.now,
41
+ }
42
+
43
+ body = ActiveSupport::JSON.decode response.body
44
+ body["update_providers"].should == false
45
+ end
46
+
47
+ it "delivers correct data" do
48
+ get :providers, :terminal => 'test'
49
+
50
+ body = ActiveSupport::JSON.decode ActiveSupport::Gzip.decompress(response.body)
51
+ DateTime.parse(body["updated_at"]).to_i.should == @terminal.terminal_profile.actual_timestamp.to_i
52
+ end
53
+
54
+ it "properly handles update scenario" do
55
+ initial_stamp = @terminal.terminal_profile.actual_timestamp
56
+
57
+ post :create, :terminal => 'test', :terminal_ping => {
58
+ :providers_updated_at => initial_stamp
59
+ }
60
+
61
+ body = ActiveSupport::JSON.decode response.body
62
+ body["update_providers"].should == false
63
+
64
+ sleep 1
65
+
66
+ @terminal.terminal_profile.invalidate_cached_providers!
67
+
68
+ post :create, :terminal => 'test', :terminal_ping => {
69
+ :providers_updated_at => initial_stamp
70
+ }
71
+
72
+ body = ActiveSupport::JSON.decode response.body
73
+ body["update_providers"].should == true
74
+
75
+ get :providers, :terminal => 'test'
76
+
77
+ body = ActiveSupport::JSON.decode ActiveSupport::Gzip.decompress(response.body)
78
+ new_stamp = DateTime.parse(body["updated_at"])
79
+ new_stamp.should > initial_stamp
80
+ new_stamp.to_i.should == @terminal.terminal_profile.actual_timestamp.to_i
81
+
82
+ post :create, :terminal => 'test', :terminal_ping => {
83
+ :providers_updated_at => new_stamp
84
+ }
85
+
86
+ body = ActiveSupport::JSON.decode response.body
87
+ body["update_providers"].should == false
88
+
89
+ end
31
90
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartkiosk-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70321654852100 !ruby/object:Gem::Requirement
16
+ requirement: &70304215974320 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.11
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70321654852100
24
+ version_requirements: *70304215974320
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: matrioshka
27
- requirement: &70321654851200 !ruby/object:Gem::Requirement
27
+ requirement: &70304215984260 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.1.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70321654851200
35
+ version_requirements: *70304215984260
36
36
  description: Smartkiosk server application
37
37
  email:
38
38
  - boris@roundlake.ru
@@ -307,7 +307,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
307
  version: '0'
308
308
  segments:
309
309
  - 0
310
- hash: 2870529153465256155
310
+ hash: -3230117856390650885
311
311
  required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  none: false
313
313
  requirements: