geopolitical 0.9.3 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +28 -0
- data/Gemfile +3 -0
- data/app/models/city.rb +15 -2
- data/app/models/concerns/geopolitocracy.rb +7 -5
- data/app/models/nation.rb +4 -0
- data/app/models/region.rb +5 -1
- data/lib/geopolitical/version.rb +1 -1
- data/spec/dummy/config/mongoid.yml +3 -9
- data/spec/dummy/log/test.log +1097 -0
- data/spec/models/city_spec.rb +13 -0
- data/spec/spec_helper.rb +2 -0
- metadata +4 -3
data/spec/models/city_spec.rb
CHANGED
@@ -92,6 +92,19 @@ describe City, type: :model do
|
|
92
92
|
expect(City.new(name: '')).not_to be_valid
|
93
93
|
end
|
94
94
|
end
|
95
|
+
|
96
|
+
describe 'sorting' do
|
97
|
+
let(:cities) { [City.make!(name: 'Abadia', souls: 500),
|
98
|
+
City.make!(name: 'Xangrilá', souls: 5000)] }
|
99
|
+
|
100
|
+
it 'should sort by name' do
|
101
|
+
expect(City.ordered).to eq cities
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'should sort by pop' do
|
105
|
+
expect(City.population).to eq cities.reverse
|
106
|
+
end
|
107
|
+
end
|
95
108
|
end
|
96
109
|
|
97
110
|
# it { should have_indices :name, :geom, :area, [:region_id, :nation_id] }
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geopolitical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcos Piccinini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -48,6 +48,7 @@ files:
|
|
48
48
|
- ".coveralls.yml"
|
49
49
|
- ".gitignore"
|
50
50
|
- ".rspec"
|
51
|
+
- ".travis.yml"
|
51
52
|
- Gemfile
|
52
53
|
- Guardfile
|
53
54
|
- MIT-LICENSE
|
@@ -163,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
164
|
version: '0'
|
164
165
|
requirements: []
|
165
166
|
rubyforge_project:
|
166
|
-
rubygems_version: 2.4.
|
167
|
+
rubygems_version: 2.4.8
|
167
168
|
signing_key:
|
168
169
|
specification_version: 4
|
169
170
|
summary: Geopolitical models for mongoid.
|