Improve specs to test for the right response status.

This commit is contained in:
Guo Xiang Tan 2017-11-24 09:32:44 +08:00
parent 407d80f1dd
commit 82222e8d18
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ describe UserBadgesController do
it "fails when badges are disabled" do it "fails when badges are disabled" do
SiteSetting.enable_badges = false SiteSetting.enable_badges = false
get :index, params: { badge_id: badge.id }, format: :json get :index, params: { badge_id: badge.id }, format: :json
expect(response).not_to be_success expect(response.status).to eq(404)
end end
end end

View File

@ -35,7 +35,7 @@ RSpec.describe UsersController do
it "fails if badges are disabled" do it "fails if badges are disabled" do
SiteSetting.enable_badges = false SiteSetting.enable_badges = false
get "/u/#{user.username}/badges" get "/u/#{user.username}/badges"
expect(response).not_to be_success expect(response.status).to eq(404)
end end
end end