Skip to content

Commit

Permalink
Add spec to ensure consent_form has a consent_text_id for api requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mnipper committed May 4, 2015
1 parent 39bf7a1 commit cd215ba
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/requests/api/v1/consent_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,20 @@
expect(response).to_not be_success
end

it 'returns an unsuccessful response if consent form has no consent_text_id' do
post @api_endpoint,
consent_form:
{
'name' => @encrypted_name,
'email' => @encrypted_email,
'date' => @consent_form.date,
'project_id' => @consent_form.project_id,
'send_email_copy' => @consent_form.send_email_copy,
'device_label' => @consent_form.device_label,
}
expect(response).to_not be_success
end

it 'should not respond to a get request' do
lambda { get @api_endpoint }.should raise_error
end
Expand Down

0 comments on commit cd215ba

Please sign in to comment.