aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/api/v1
diff options
context:
space:
mode:
authorTeddy Wing2017-11-08 16:43:31 +0100
committercedricnjanga2017-11-13 17:52:54 +0100
commit80f932d417744488c7dadc53d7369ca573f1fc61 (patch)
tree77b5c20fc5067f303812d94493337294bf88c385 /spec/controllers/api/v1
parent089f3d3268aa73acdb162a5479740bb2d36aff67 (diff)
downloadchouette-core-80f932d417744488c7dadc53d7369ca573f1fc61.tar.bz2
ComplianceCheckSetsController: Get ComplianceCheckSet and update status
Get the `ComplianceCheckSet` from the URL and call its `#update_status` method. This doesn't currently work all the way. We need to send a real response. Refs #4757
Diffstat (limited to 'spec/controllers/api/v1')
-rw-r--r--spec/controllers/api/v1/compliance_check_sets_controller_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/controllers/api/v1/compliance_check_sets_controller_spec.rb b/spec/controllers/api/v1/compliance_check_sets_controller_spec.rb
index c9c58c7cb..e8e24b530 100644
--- a/spec/controllers/api/v1/compliance_check_sets_controller_spec.rb
+++ b/spec/controllers/api/v1/compliance_check_sets_controller_spec.rb
@@ -1,7 +1,12 @@
RSpec.describe Api::V1::ComplianceCheckSetsController, type: :controller do
+ include_context 'iboo authenticated api user'
+
describe "POST #validate" do
- it "calls [that thing that updates statuses on ComplianceCheckX]" do
- post :validated, params: { id: 5 }
+ it "calls #update_status on the ComplianceCheckSet" do
+ check_set = create(:compliance_check_set)
+ expect_any_instance_of(ComplianceCheckSet).to receive(:update_status)
+
+ patch :validated, id: check_set.id
end
end
end