cookbook 0.1.1 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -14
- data/README.md +0 -2
- data/VERSION +1 -1
- data/app/models/cookbook/use.rb +26 -8
- data/cookbook.gemspec +6 -6
- data/lib/cookbook/mixins/acts_as_use_of.rb +32 -3
- data/lib/cookbook/mixins/acts_as_used_in.rb +22 -4
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +1092 -0
- data/spec/dummy/log/test.log +8758 -0
- data/spec/models/cookbook/use_spec.rb +2 -13
- data/spec/models/how_to_spec.rb +3 -3
- data/spec/models/recipe_spec.rb +3 -3
- metadata +4 -4
@@ -42,17 +42,6 @@ RSpec.describe Cookbook::Use, type: :model do
|
|
42
42
|
it { should belong_to(:use_in) }
|
43
43
|
end
|
44
44
|
|
45
|
-
describe 'Scopes' do
|
46
|
-
describe '.recipe_uses' do
|
47
|
-
subject { Cookbook::Use.recipe_uses }
|
48
|
-
it { should include(full_use) }
|
49
|
-
end
|
50
|
-
describe '.ingredient_uses' do
|
51
|
-
subject { Cookbook::Use.ingredient_uses }
|
52
|
-
it { should include(full_use) }
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
45
|
describe 'Methods' do
|
57
46
|
describe '#quantity' do
|
58
47
|
describe 'when min and max exist' do
|
@@ -61,11 +50,11 @@ RSpec.describe Cookbook::Use, type: :model do
|
|
61
50
|
end
|
62
51
|
describe 'with just min' do
|
63
52
|
subject { use_no_max_no_unit.quantity }
|
64
|
-
it { should eq '0.25' }
|
53
|
+
it { should eq '0.25' }
|
65
54
|
end
|
66
55
|
describe 'with just max' do
|
67
56
|
subject { use_no_min_no_unit.quantity }
|
68
|
-
it { should eq '2' }
|
57
|
+
it { should eq '2' }
|
69
58
|
end
|
70
59
|
end
|
71
60
|
describe '#quantity and unit' do
|
data/spec/models/how_to_spec.rb
CHANGED
@@ -7,12 +7,12 @@ RSpec.describe HowTo, type: :model do
|
|
7
7
|
it { should have_many(:uses) }
|
8
8
|
|
9
9
|
it { should_not have_many(:ingredient_uses) }
|
10
|
-
it { should_not have_many(:ingredients).through(:
|
10
|
+
it { should_not have_many(:ingredients).through(:ingredient_uses) }
|
11
11
|
|
12
12
|
it { should have_many(:supply_uses) }
|
13
|
-
it { should have_many(:supplies).through(:
|
13
|
+
it { should have_many(:supplies).through(:supply_uses) }
|
14
14
|
|
15
15
|
it { should have_many(:tool_uses) }
|
16
|
-
it { should have_many(:tools).through(:
|
16
|
+
it { should have_many(:tools).through(:tool_uses) }
|
17
17
|
end
|
18
18
|
end
|
data/spec/models/recipe_spec.rb
CHANGED
@@ -7,12 +7,12 @@ RSpec.describe Recipe, type: :model do
|
|
7
7
|
it { should have_many(:uses) }
|
8
8
|
|
9
9
|
it { should have_many(:ingredient_uses) }
|
10
|
-
it { should have_many(:ingredients).through(:
|
10
|
+
it { should have_many(:ingredients).through(:ingredient_uses) }
|
11
11
|
|
12
12
|
it { should have_many(:supply_uses) }
|
13
|
-
it { should have_many(:supplies).through(:
|
13
|
+
it { should have_many(:supplies).through(:supply_uses) }
|
14
14
|
|
15
15
|
it { should have_many(:tool_uses) }
|
16
|
-
it { should have_many(:tools).through(:
|
16
|
+
it { should have_many(:tools).through(:tool_uses) }
|
17
17
|
end
|
18
18
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cookbook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Loren Lundgren
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
59
|
+
version: '5'
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '7'
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '5'
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '7'
|