Skip to content

Commit

Permalink
improve end hold controller code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Apodaca committed May 10, 2019
1 parent fa79cca commit 71df9b7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion spec/controllers/tasks/end_hold_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,24 @@
context "with a non-existent parent_id" do
let(:parent_id) { parent.id + 999 }

it "returns an error" do
it "returns a not found error" do
subject

expect(response.status).to eq(404)
end
end

context "when the user is missing" do
before do
user.destroy!
end

it "returns an invalid record error" do
subject

expect(response.status).to eq(400)
expect(JSON.parse(response.body)["errors"][0]["title"]).to eq "Record is invalid"
end
end
end
end

0 comments on commit 71df9b7

Please sign in to comment.