mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Fix more controller actions
This commit is contained in:
@@ -186,8 +186,8 @@ RSpec.describe GroupsController do
|
||||
|
||||
it "shows" do
|
||||
get :show, params: { id: group.id }
|
||||
expect(response).to be_successful
|
||||
expect(response).to render_template "show"
|
||||
expect(response).not_to be_successful
|
||||
expect(response).to have_http_status :not_found
|
||||
end
|
||||
|
||||
context "when having view_members permission in a project the group belongs to" do
|
||||
@@ -199,6 +199,11 @@ RSpec.describe GroupsController do
|
||||
create(:member, project:, principal: group, roles: [create(:project_role)])
|
||||
end
|
||||
|
||||
it "shows" do
|
||||
get :show, params: { id: group.id }
|
||||
expect(response).to be_successful
|
||||
end
|
||||
|
||||
it "shows members" do
|
||||
get :show, params: { id: group.id }
|
||||
expect(assigns(:group_users)).to match_array(group_members)
|
||||
@@ -217,7 +222,9 @@ RSpec.describe GroupsController do
|
||||
|
||||
it "does not show members" do
|
||||
get :show, params: { id: group.id }
|
||||
expect(assigns(:group_users)).to be_empty
|
||||
|
||||
expect(response).to have_http_status :not_found
|
||||
expect(assigns(:group_users)).to be_blank
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -274,7 +274,11 @@ RSpec.describe PlaceholderUsersController do
|
||||
end
|
||||
|
||||
describe "GET show" do
|
||||
it_behaves_like "renders the show template"
|
||||
before do
|
||||
get :show, params: { id: placeholder_user.id }
|
||||
end
|
||||
|
||||
it { expect(response).to have_http_status :not_found }
|
||||
end
|
||||
|
||||
describe "GET edit" do
|
||||
|
||||
@@ -64,7 +64,7 @@ RSpec.describe WikiMenuItemsController do
|
||||
|
||||
get "edit", params: @params
|
||||
|
||||
expect(response).to have_http_status(:forbidden)
|
||||
expect(response).to have_http_status(:not_found)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user