rspec-coverage #22

Merged
bucky merged 13 commits from rspec-coverage into master 2023-10-12 23:49:49 -07:00
Showing only changes of commit 213265a5d0 - Show all commits
+10
View File
@@ -88,4 +88,14 @@ describe "Submit API request to create new link" do
response_json = JSON.parse(last_response.body) response_json = JSON.parse(last_response.body)
expect(response_json['message']).to eq('url does not resolve') expect(response_json['message']).to eq('url does not resolve')
end end
it "should return with a 400 status and 'not a valid json request' message when a request is made with the wrong content type header" do
data = {
url: 'http://google.com'
}
post('/links', data.to_json)
expect(last_response.status).to eq(400)
response_json = JSON.parse(last_response.body)
expect(response_json['message']).to eq('not a valid json request')
end
end end