From e64e6351bd627f708f6d3244b1505b1d1edcdc36 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 11 Aug 2020 13:53:11 +0800 Subject: [PATCH] DEV: Assert for response status in tests. --- spec/requests/groups_controller_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/requests/groups_controller_spec.rb b/spec/requests/groups_controller_spec.rb index c19e0f2464a..10345f3dd5e 100644 --- a/spec/requests/groups_controller_spec.rb +++ b/spec/requests/groups_controller_spec.rb @@ -1771,6 +1771,8 @@ describe GroupsController do it "does not return categories the user cannot see" do get "/groups/#{group.name}/permissions.json" + + expect(response.status).to eq(200) expect(response.parsed_body).to eq([]) end @@ -1778,6 +1780,8 @@ describe GroupsController do group.add(other_user) get "/groups/#{group.name}/permissions.json" + + expect(response.status).to eq(200) expect(response.parsed_body.count).to eq(1) expect(response.parsed_body.first["category"]["id"]).to eq(category.id) end @@ -1793,6 +1797,9 @@ describe GroupsController do end get "/groups/#{group.name}/permissions.json" + + expect(response.status).to eq(200) + expect(response.parsed_body.map { |permission| permission["category"]["name"] }).to eq( ["Abc", "Hello", "New Cat", "Three"] )