rest_my_case 1.11.6 → 1.11.7
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 626ba1eecdf25814ed56cafae419c38d7c4ea889
|
4
|
+
data.tar.gz: c797998649c9038af80eff4017293ee03c024f66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c296d0cad02320de30050283c5c66b7bf96118383874a22861f7111fc04bd2443e449a20bb93d4ac44e9e808eb26345933c12a3afab821e5707cb65a7d26e7b0
|
7
|
+
data.tar.gz: 47818e573ff4a6b224bae82c803ee1bca29825bd09f1b77507032ef2427ac0680b840196887e7c9f889142fee9c64d9c9c93fb6375ff5af94589941d0a5b76a6
|
@@ -30,10 +30,10 @@ module RestMyCase
|
|
30
30
|
validate_context_aborts?(@trial_case.defendant_child)
|
31
31
|
|
32
32
|
@trial_case.use_cases.each do |use_case|
|
33
|
-
validate_context_aborts?(use_case)
|
34
|
-
|
35
33
|
next if use_case.options[:should_skip] || @use_case_that_aborted
|
36
34
|
|
35
|
+
validate_context_aborts?(use_case)
|
36
|
+
|
37
37
|
@performed_use_cases.push use_case
|
38
38
|
|
39
39
|
method_aborts?(:perform, use_case)
|
data/lib/rest_my_case/version.rb
CHANGED
@@ -32,21 +32,17 @@ describe RestMyCase::Base do
|
|
32
32
|
expect(@context.ok?).to be false
|
33
33
|
end
|
34
34
|
|
35
|
-
it "context errors should include
|
36
|
-
expect(@context.errors.length).to be
|
35
|
+
it "context errors should only include the first context_errors" do
|
36
|
+
expect(@context.errors.length).to be 1
|
37
37
|
expect(@context.errors[0][:context_errors][:id]).to be_truthy
|
38
|
-
expect(@context.errors[1][:context_errors][:post]).to be_truthy
|
39
|
-
expect(@context.errors[1][:context_errors][:post_attributes]).to be_truthy
|
40
|
-
expect(@context.errors[2][:context_errors][:post]).to be_truthy
|
41
38
|
end
|
42
39
|
end
|
43
40
|
|
44
41
|
context "When the required_context of a class fails and one of the dependencies aborts first" do
|
45
42
|
before { @context = RequiredContext::Comments::Update.perform }
|
46
43
|
|
47
|
-
|
48
|
-
|
49
|
-
# expect(@context.current_user).to be nil
|
44
|
+
it "required_context should not have ran" do
|
45
|
+
expect(@context.errors.length).to be 1
|
50
46
|
end
|
51
47
|
end
|
52
48
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RestMyCase::Context::Base do
|
4
|
+
|
5
|
+
describe '#values_at' do
|
6
|
+
let(:context) { described_class.new(one: 1, two: 2, three: 3) }
|
7
|
+
|
8
|
+
context "no params are used" do
|
9
|
+
it 'empty array should be returned' do
|
10
|
+
expect(context.values_at).to eq []
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "when all of the params are known" do
|
15
|
+
it 'all of the values should be returned' do
|
16
|
+
expect(context.values_at(:one, :two, :three)).to eq [1, 2, 3]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "when trying to extract less values then all of the known attributes" do
|
21
|
+
it 'nil will be returned in the place of the unknown' do
|
22
|
+
expect(context.values_at(:one, :two, :four)).to eq [1, 2, nil]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context "when one of the params is not known" do
|
27
|
+
it 'just the known values should be returned' do
|
28
|
+
expect(context.values_at(:one, :two)).to eq [1, 2]
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_my_case
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goncalvesjoao
|
@@ -157,6 +157,7 @@ files:
|
|
157
157
|
- spec/rest_my_case/base/invoke_spec.rb
|
158
158
|
- spec/rest_my_case/base/perform_spec.rb
|
159
159
|
- spec/rest_my_case/base/required_context_spec.rb
|
160
|
+
- spec/rest_my_case/context/base_spec.rb
|
160
161
|
- spec/rest_my_case/context/status_spec.rb
|
161
162
|
- spec/rest_my_case/defense_attorney/base_spec.rb
|
162
163
|
- spec/rest_my_case/http_status_spec.rb
|
@@ -214,6 +215,7 @@ test_files:
|
|
214
215
|
- spec/rest_my_case/base/invoke_spec.rb
|
215
216
|
- spec/rest_my_case/base/perform_spec.rb
|
216
217
|
- spec/rest_my_case/base/required_context_spec.rb
|
218
|
+
- spec/rest_my_case/context/base_spec.rb
|
217
219
|
- spec/rest_my_case/context/status_spec.rb
|
218
220
|
- spec/rest_my_case/defense_attorney/base_spec.rb
|
219
221
|
- spec/rest_my_case/http_status_spec.rb
|