settingson 1.3.2 → 1.3.3
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.
- checksums.yaml +4 -4
- data/lib/settingson/version.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/models/settings_spec.rb +32 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a77885b41ca726f823a234d80a0c44050fb73e9
|
4
|
+
data.tar.gz: e1a4139d33964310e1a3e25bd4944f4376919f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb589bb44a7d0c460d0c23024ee465c7477aa843ec39dbd9f774a0eb8f1c308ffd41cfe327cf7a3eb4233b6f19616b6694a074f90dae8f1d746ef56919de9ec6
|
7
|
+
data.tar.gz: 9d569fefd9845fea7d5ae67bbf21b4695cfe17c2414ffb696343fe8d0a28057479a8e89b7b1cc42539bb24197fcbb48ed40e7b19d92154e73e9db9cc7e9898c2
|
data/lib/settingson/version.rb
CHANGED
@@ -13,7 +13,7 @@ Rails.application.configure do
|
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
15
|
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
-
config.
|
16
|
+
config.serve_static_files = true
|
17
17
|
config.static_cache_control = 'public, max-age=3600'
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
@@ -7,32 +7,58 @@ describe Settings do
|
|
7
7
|
it 'not raises error on create new element' do
|
8
8
|
expect{ Settings.hello = Faker::Lorem.word }.to_not raise_error
|
9
9
|
end
|
10
|
-
it 'returns same
|
10
|
+
it 'returns same Fixnum' do
|
11
|
+
word = Faker::Lorem.word
|
12
|
+
Settings.number = 100
|
13
|
+
expect( Settings.number ).to eq(100)
|
14
|
+
end
|
15
|
+
it 'returns same String' do
|
11
16
|
word = Faker::Lorem.word
|
12
17
|
Settings.hello = word
|
13
18
|
expect( Settings.hello ).to eq(word)
|
14
19
|
end
|
15
|
-
it 'returns same value for
|
20
|
+
it 'returns same value for complex key #1' do
|
16
21
|
word = Faker::Lorem.word
|
17
22
|
Settings.hello.hello = word
|
18
23
|
expect( Settings.hello.hello ).to eq(word)
|
19
24
|
end
|
20
|
-
it 'returns same value for
|
25
|
+
it 'returns same value for complex key #2' do
|
21
26
|
word = Faker::Lorem.word
|
22
27
|
Settings.i.hello = word
|
23
28
|
expect( Settings.i.hello ).to eq(word)
|
24
29
|
end
|
25
30
|
|
26
|
-
it 'destroys record with nil value
|
31
|
+
it 'destroys record with nil value #1' do
|
27
32
|
word = Faker::Lorem.word
|
28
33
|
Settings.some = word
|
29
34
|
expect{ Settings.some = nil }.to change{ Settings.count }.by(-1)
|
30
35
|
end
|
31
36
|
|
32
|
-
it 'destroys record with nil value
|
37
|
+
it 'destroys record with nil value #2' do
|
33
38
|
word = Faker::Lorem.word
|
34
39
|
Settings.some.hello = word
|
35
40
|
expect{ Settings.some.hello = nil }.to change{ Settings.count }.by(-1)
|
36
41
|
end
|
37
42
|
|
38
|
-
|
43
|
+
describe 'with empty value' do
|
44
|
+
it 'returns empty string' do
|
45
|
+
expect( "#{Settings.not_found}" ).to eq("")
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'returns value.nil? is true' do
|
49
|
+
expect( Settings.not_found.nil? ).to be(true)
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'returns value.empty? is true' do
|
53
|
+
expect( Settings.not_found.empty? ).to be(true)
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'returns value.blank? is true' do
|
57
|
+
expect( Settings.not_found.blank? ).to be(true)
|
58
|
+
end
|
59
|
+
|
60
|
+
it 'returns value.present? is false' do
|
61
|
+
expect( Settings.not_found.present? ).to be(false)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: settingson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|