aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorTeddy Wing2017-11-13 16:27:49 +0100
committercedricnjanga2017-11-13 17:52:54 +0100
commite57f45bd6478baeab25ae96ae688587dda85247f (patch)
tree5b5bac8670fbf295921e1d04c0cb46641f7b68b2 /spec
parent5dd6b2f963d3ae732c6f56112e5f5ac56b6c2764 (diff)
downloadchouette-core-e57f45bd6478baeab25ae96ae688587dda85247f.tar.bz2
ComplianceCheckSet#update_status: Return `true` if no update happened
Return `true` from this method by default. If the `#update` call fails, then it will return `false`, but in all other cases, we should return `true`. That way, when the `Api::V1::ComplianceCheckSetsController#validated` endpoint is called, it will respond with the `ComplianceCheckSet` object instead of: {"status":"error","messages":[]} with no error messages. Refs #4757
Diffstat (limited to 'spec')
-rw-r--r--spec/models/compliance_check_set_spec.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/models/compliance_check_set_spec.rb b/spec/models/compliance_check_set_spec.rb
index d09a9cc95..0159d1c6b 100644
--- a/spec/models/compliance_check_set_spec.rb
+++ b/spec/models/compliance_check_set_spec.rb
@@ -82,5 +82,11 @@ RSpec.describe ComplianceCheckSet, type: :model do
expect(check_set.status).to eq('successful')
end
+
+ it "returns true when the status did not get updated" do
+ check_set = create(:compliance_check_set)
+
+ expect(check_set.update_status).to be true
+ end
end
end