Improve specs to test for the right response status.
This commit is contained in:
parent
407d80f1dd
commit
82222e8d18
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue