spyme 0.0.1 → 0.1.1

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.
@@ -6,19 +6,19 @@ class SpymeTest < ActionDispatch::IntegrationTest
6
6
  end
7
7
 
8
8
  test "post to spyme should return success" do
9
- post '/spyme/locations', @params
9
+ post '/spyme/locations', params: @params
10
10
  assert_response 201
11
11
  end
12
12
 
13
13
  test "post to spyme should store coords" do
14
- post '/spyme/locations', @params
14
+ post '/spyme/locations', params: @params
15
15
 
16
16
  assert_equal session[:latitude], '64.24145'
17
17
  assert_equal session[:longitude], '75.35536'
18
18
  end
19
19
 
20
20
  test 'post to spyme should not throw bad request when empty' do
21
- post '/spyme/locations', {}
21
+ post '/spyme/locations', params: { location: { latitude: nil, longitude: nil} }
22
22
 
23
23
  assert_response 400
24
24
  end
@@ -24,6 +24,26 @@ class ModelTest < ActiveSupport::TestCase
24
24
  assert_equal @location.valid?, false
25
25
  end
26
26
 
27
+ test 'location should be valid at negative boundries' do
28
+ @location = Spyme::Model::Location.new(latitude: -90.0, longitude: -180.0)
29
+
30
+ assert_equal @location.valid?, true
31
+ end
32
+
33
+ test 'location should be valid at positive boundries' do
34
+ @location = Spyme::Model::Location.new(latitude: 90.0, longitude: 180.0)
35
+
36
+ assert_equal @location.valid?, true
37
+ end
38
+
39
+ test 'location should be invalid exceeding negative boundries' do
40
+ loc_lat = Spyme::Model::Location.new(latitude: -90.00001, longitude: 130.0)
41
+ loc_lon = Spyme::Model::Location.new(latitude: 45.0, longitude: -180.00001)
42
+
43
+ assert_equal loc_lat.valid?, false
44
+ assert_equal loc_lon.valid?, false
45
+ end
46
+
27
47
  test 'initialize from session should give correct number attributes' do
28
48
  assert_equal @location.latitude, 54.34212
29
49
  assert_equal @location.longitude, 32.14424
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spyme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juani Villarejo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-02 00:00:00.000000000 Z
11
+ date: 2018-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '4.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sqlite3
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  description: With spyme you can store and access user browser geolocated position
@@ -89,6 +89,7 @@ files:
89
89
  - test/dummy/config/routes.rb
90
90
  - test/dummy/config/secrets.yml
91
91
  - test/dummy/db/development.sqlite3
92
+ - test/dummy/db/schema.rb
92
93
  - test/dummy/db/test.sqlite3
93
94
  - test/dummy/log/development.log
94
95
  - test/dummy/log/test.log
@@ -96,12 +97,6 @@ files:
96
97
  - test/dummy/public/422.html
97
98
  - test/dummy/public/500.html
98
99
  - test/dummy/public/favicon.ico
99
- - test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
100
- - test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
101
- - test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
102
- - test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
103
- - test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
104
- - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
105
100
  - test/integration/spyme_test.rb
106
101
  - test/models/model_test.rb
107
102
  - test/test_helper.rb
@@ -116,67 +111,62 @@ require_paths:
116
111
  - lib
117
112
  required_ruby_version: !ruby/object:Gem::Requirement
118
113
  requirements:
119
- - - '>='
114
+ - - ">="
120
115
  - !ruby/object:Gem::Version
121
116
  version: '0'
122
117
  required_rubygems_version: !ruby/object:Gem::Requirement
123
118
  requirements:
124
- - - '>='
119
+ - - ">="
125
120
  - !ruby/object:Gem::Version
126
121
  version: '0'
127
122
  requirements: []
128
123
  rubyforge_project:
129
- rubygems_version: 2.3.0
124
+ rubygems_version: 2.7.6
130
125
  signing_key:
131
126
  specification_version: 4
132
127
  summary: A Rails plugin that tracks and store browser geolocation position
133
128
  test_files:
129
+ - test/test_helper.rb
130
+ - test/integration/spyme_test.rb
134
131
  - test/models/model_test.rb
135
- - test/dummy/bin/rails
136
- - test/dummy/bin/rake
137
- - test/dummy/bin/bundle
132
+ - test/dummy/Rakefile
133
+ - test/dummy/config.ru
134
+ - test/dummy/app/views/home/start.html.erb
135
+ - test/dummy/app/views/home/my_location.html.erb
136
+ - test/dummy/app/views/layouts/application.html.erb
138
137
  - test/dummy/app/assets/stylesheets/application.css
139
138
  - test/dummy/app/assets/javascripts/application.js
140
139
  - test/dummy/app/controllers/application_controller.rb
141
140
  - test/dummy/app/controllers/home_controller.rb
142
141
  - test/dummy/app/helpers/application_helper.rb
143
- - test/dummy/app/views/home/start.html.erb
144
- - test/dummy/app/views/home/my_location.html.erb
145
- - test/dummy/app/views/layouts/application.html.erb
146
- - test/dummy/Rakefile
147
- - test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994
148
- - test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af
149
- - test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6
150
- - test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655
151
- - test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705
152
- - test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953
153
- - test/dummy/config.ru
142
+ - test/dummy/log/development.log
143
+ - test/dummy/log/test.log
144
+ - test/dummy/public/422.html
154
145
  - test/dummy/public/500.html
155
146
  - test/dummy/public/favicon.ico
156
- - test/dummy/public/422.html
157
147
  - test/dummy/public/404.html
158
- - test/dummy/db/test.sqlite3
148
+ - test/dummy/README.rdoc
149
+ - test/dummy/bin/rails
150
+ - test/dummy/bin/bundle
151
+ - test/dummy/bin/rake
159
152
  - test/dummy/db/development.sqlite3
160
- - test/dummy/log/test.log
161
- - test/dummy/log/development.log
162
- - test/dummy/config/initializers/session_store.rb
163
- - test/dummy/config/initializers/cookies_serializer.rb
164
- - test/dummy/config/initializers/filter_parameter_logging.rb
165
- - test/dummy/config/initializers/backtrace_silencers.rb
153
+ - test/dummy/db/schema.rb
154
+ - test/dummy/db/test.sqlite3
155
+ - test/dummy/config/secrets.yml
156
+ - test/dummy/config/boot.rb
157
+ - test/dummy/config/environment.rb
166
158
  - test/dummy/config/initializers/wrap_parameters.rb
167
159
  - test/dummy/config/initializers/inflections.rb
168
- - test/dummy/config/initializers/mime_types.rb
160
+ - test/dummy/config/initializers/backtrace_silencers.rb
169
161
  - test/dummy/config/initializers/assets.rb
170
- - test/dummy/config/routes.rb
162
+ - test/dummy/config/initializers/filter_parameter_logging.rb
163
+ - test/dummy/config/initializers/mime_types.rb
164
+ - test/dummy/config/initializers/session_store.rb
165
+ - test/dummy/config/initializers/cookies_serializer.rb
171
166
  - test/dummy/config/application.rb
172
- - test/dummy/config/environment.rb
173
- - test/dummy/config/locales/en.yml
174
- - test/dummy/config/environments/test.rb
167
+ - test/dummy/config/routes.rb
175
168
  - test/dummy/config/environments/production.rb
176
169
  - test/dummy/config/environments/development.rb
170
+ - test/dummy/config/environments/test.rb
171
+ - test/dummy/config/locales/en.yml
177
172
  - test/dummy/config/database.yml
178
- - test/dummy/config/secrets.yml
179
- - test/dummy/config/boot.rb
180
- - test/dummy/README.rdoc
181
- - test/test_helper.rb
182
- - test/integration/spyme_test.rb