#345: update api/v1/issues_controller_spec
This commit is contained in:
parent
4166951cda
commit
9fece259d8
|
@ -6,6 +6,7 @@ class Api::V1::IssuesController < Api::V1::BaseController
|
||||||
|
|
||||||
load_and_authorize_resource :group, only: :group_index, find_by: :id, parent: false
|
load_and_authorize_resource :group, only: :group_index, find_by: :id, parent: false
|
||||||
load_and_authorize_resource :project
|
load_and_authorize_resource :project
|
||||||
|
skip_load_and_authorize_resource :project, only: [:all_index, :user_index, :group_index]
|
||||||
load_and_authorize_resource :issue, through: :project, find_by: :serial_id, only: [:show, :update, :create, :index]
|
load_and_authorize_resource :issue, through: :project, find_by: :serial_id, only: [:show, :update, :create, :index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -60,7 +61,7 @@ class Api::V1::IssuesController < Api::V1::BaseController
|
||||||
private
|
private
|
||||||
|
|
||||||
def render_issues_list
|
def render_issues_list
|
||||||
@issues = @issues.includes(:user, :assignee, :labels).without_pull_requests
|
@issues = @issues.preload(:user, :assignee, :labels, :project).without_pull_requests
|
||||||
if params[:status] == 'closed'
|
if params[:status] == 'closed'
|
||||||
@issues = @issues.closed
|
@issues = @issues.closed
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Api::V1::IssuesController do
|
describe Api::V1::IssuesController do
|
||||||
before(:all) do
|
before do
|
||||||
stub_symlink_methods
|
stub_symlink_methods
|
||||||
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
|
||||||
|
|
||||||
|
@ -213,8 +213,4 @@ describe Api::V1::IssuesController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
after(:all) do
|
|
||||||
User.destroy_all
|
|
||||||
Platform.destroy_all
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue