diff options
| author | Teddy Wing | 2017-11-13 16:27:49 +0100 |
|---|---|---|
| committer | cedricnjanga | 2017-11-13 17:52:54 +0100 |
| commit | e57f45bd6478baeab25ae96ae688587dda85247f (patch) | |
| tree | 5b5bac8670fbf295921e1d04c0cb46641f7b68b2 /spec | |
| parent | 5dd6b2f963d3ae732c6f56112e5f5ac56b6c2764 (diff) | |
| download | chouette-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.rb | 6 |
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 |
