addresses 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/addresses/cities_controller.rb +1 -2
- data/app/models/addresses/city.rb +20 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +3215 -2338
- data/spec/models/addresses/city_spec.rb +12 -0
- metadata +2 -4
- data/spec/dummy/db/development.sqlite3 +0 -0
@@ -5,4 +5,16 @@ RSpec.describe Addresses::City, :type => :model do
|
|
5
5
|
it { is_expected.to belong_to(:state) }
|
6
6
|
it { is_expected.to have_many(:neighborhoods) }
|
7
7
|
end
|
8
|
+
|
9
|
+
describe '#methods' do
|
10
|
+
describe '#filter' do
|
11
|
+
let!(:state) { create :state }
|
12
|
+
let!(:state2) { create :state }
|
13
|
+
let!(:city) { create :city, state: state, name: 'Natal' }
|
14
|
+
let!(:city2) { create :city, state: state2, name: 'São Paulo' }
|
15
|
+
|
16
|
+
it { expect(Addresses::City.filter.all).to eq([city, city2]) }
|
17
|
+
it { expect(Addresses::City.filter(name: 'paulo').all).to eq([city2]) }
|
18
|
+
end
|
19
|
+
end
|
8
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: addresses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wilbert Ribeiro
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -144,7 +144,6 @@ files:
|
|
144
144
|
- spec/dummy/config/locales/en.yml
|
145
145
|
- spec/dummy/config/locales/pt-BR.yml
|
146
146
|
- spec/dummy/config/routes.rb
|
147
|
-
- spec/dummy/db/development.sqlite3
|
148
147
|
- spec/dummy/db/schema.rb
|
149
148
|
- spec/dummy/db/test.sqlite3
|
150
149
|
- spec/dummy/log/test.log
|
@@ -245,7 +244,6 @@ test_files:
|
|
245
244
|
- spec/dummy/public/404.html
|
246
245
|
- spec/dummy/db/schema.rb
|
247
246
|
- spec/dummy/db/test.sqlite3
|
248
|
-
- spec/dummy/db/development.sqlite3
|
249
247
|
- spec/dummy/Gemfile
|
250
248
|
- spec/dummy/log/test.log
|
251
249
|
- spec/dummy/Gemfile.lock
|
Binary file
|