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 11206854ad - Show all commits
+11 -3
View File
@@ -45,8 +45,8 @@ describe "Submit API request to create new link" do
expect(last_response.status).to eq(400)
response_json = JSON.parse(last_response.body)
expect(response_json['message']).to eq('invalid url parameter')
end
it "should return with a 400 status and 'missing url parameter' message when an empty url is submitted" do
data = {
}
@@ -54,7 +54,15 @@ describe "Submit API request to create new link" do
expect(last_response.status).to eq(400)
response_json = JSON.parse(last_response.body)
expect(response_json['message']).to eq('missing url parameter')
end
end
it "should return with a 400 status and 'invalid url parameter' message when an invalid url is submitted" do
data = {
url: 'not-an-url'
}
post('/links', data.to_json, "CONTENT_TYPE" => "application/json")
expect(last_response.status).to eq(400)
response_json = JSON.parse(last_response.body)
expect(response_json['message']).to eq('invalid url parameter')
end
end