mas-rad_core 0.0.87 → 0.0.88
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/app/models/investment_size.rb +8 -0
- data/lib/mas/rad_core/version.rb +1 -1
- data/spec/dummy/log/test.log +0 -0
- data/spec/models/investment_size_spec.rb +35 -0
- 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: 38b9c7f5588aef51cc80e47e9c953908931c4eda
|
4
|
+
data.tar.gz: c3ed57a917ac38c63906b70563c092d36b8de3fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1414e7800949b42615ef27c073f23771b58169cea824f5433a5a3e9423858366e958490d126d7aa28a42a822fe33e7d4546b56bfbe0ad339b337981c8a262076
|
7
|
+
data.tar.gz: 02fc0382900832baa5d9b89d6e1e364181896e8fcf41e6e8f84687f98a3228ff408faf626b09556f208d0431571f551c61ec6dee210e37cb8ea7c1a349ab6a0e
|
data/lib/mas/rad_core/version.rb
CHANGED
data/spec/dummy/log/test.log
CHANGED
Binary file
|
@@ -2,4 +2,39 @@ RSpec.describe InvestmentSize do
|
|
2
2
|
it_behaves_like 'reference data'
|
3
3
|
it_behaves_like 'translatable'
|
4
4
|
it_behaves_like 'friendly named'
|
5
|
+
|
6
|
+
context 'identifying the lowest defined value' do
|
7
|
+
let(:lower_limit_ordinal) { 1 }
|
8
|
+
let(:upper_limit_ordinal) { 5 }
|
9
|
+
let(:ordinals) { (lower_limit_ordinal..upper_limit_ordinal).to_a }
|
10
|
+
before do
|
11
|
+
# Reversing the ordinals so the default sort order is not the same as the
|
12
|
+
# order of creation and so hopefully prove we are not dependent on DB
|
13
|
+
# allocated IDs in any way
|
14
|
+
ordinals.reverse.each do |ordinal|
|
15
|
+
FactoryGirl.create(:investment_size, order: ordinal)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe '.lowest' do
|
20
|
+
it 'returns the investment size with the lowest order value' do
|
21
|
+
expect(described_class.lowest.order).to eq(lower_limit_ordinal)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '#lowest?' do
|
26
|
+
let(:record) { described_class.find_by(order: ordinal) }
|
27
|
+
subject { record.lowest? }
|
28
|
+
|
29
|
+
context 'when the subject is the lowest value' do
|
30
|
+
let(:ordinal) { lower_limit_ordinal }
|
31
|
+
it { is_expected.to be(true) }
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'when the subject is not the lowest value' do
|
35
|
+
let(:ordinal) { upper_limit_ordinal }
|
36
|
+
it { is_expected.to be(false) }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
5
40
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mas-rad_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.88
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Lovell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|