mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
DEV: Assert for 200 response code to avoid changing magic helper in the future.
This commit is contained in:
@@ -24,7 +24,7 @@ describe DirectoryItemsController do
|
||||
|
||||
it "succeeds" do
|
||||
get '/directory_items.json', params: { period: 'all' }
|
||||
expect(response).to be_successful
|
||||
expect(response.status).to eq(200)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -37,7 +37,7 @@ describe DirectoryItemsController do
|
||||
|
||||
it "succeeds with a valid value" do
|
||||
get '/directory_items.json', params: { period: 'all' }
|
||||
expect(response).to be_successful
|
||||
expect(response.status).to eq(200)
|
||||
json = ::JSON.parse(response.body)
|
||||
|
||||
expect(json).to be_present
|
||||
@@ -58,7 +58,7 @@ describe DirectoryItemsController do
|
||||
|
||||
it "finds user by name" do
|
||||
get '/directory_items.json', params: { period: 'all', name: 'eviltrout' }
|
||||
expect(response).to be_successful
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
json = ::JSON.parse(response.body)
|
||||
expect(json).to be_present
|
||||
@@ -69,7 +69,7 @@ describe DirectoryItemsController do
|
||||
|
||||
it "finds staged user by name" do
|
||||
get '/directory_items.json', params: { period: 'all', name: 'stage_user' }
|
||||
expect(response).to be_successful
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
json = ::JSON.parse(response.body)
|
||||
expect(json).to be_present
|
||||
@@ -80,7 +80,7 @@ describe DirectoryItemsController do
|
||||
|
||||
it "excludes users by username" do
|
||||
get '/directory_items.json', params: { period: 'all', exclude_usernames: "stage_user,eviltrout" }
|
||||
expect(response).to be_successful
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
json = ::JSON.parse(response.body)
|
||||
expect(json).to be_present
|
||||
@@ -92,7 +92,7 @@ describe DirectoryItemsController do
|
||||
|
||||
it "filters users by group" do
|
||||
get '/directory_items.json', params: { period: 'all', group: group.name }
|
||||
expect(response).to be_successful
|
||||
expect(response.status).to eq(200)
|
||||
|
||||
json = ::JSON.parse(response.body)
|
||||
expect(json).to be_present
|
||||
|
||||
Reference in New Issue
Block a user