#345: update api/v1/issues_controller_spec

This commit is contained in:
Vokhmin Alexey V 2014-03-21 02:28:17 +04:00
parent 4166951cda
commit 9fece259d8
2 changed files with 3 additions and 6 deletions

View File

@ -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 :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]
def index
@ -60,7 +61,7 @@ class Api::V1::IssuesController < Api::V1::BaseController
private
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'
@issues = @issues.closed
else

View File

@ -1,7 +1,7 @@
require 'spec_helper'
describe Api::V1::IssuesController do
before(:all) do
before do
stub_symlink_methods
any_instance_of(Project, versions: ['v1.0', 'v2.0'])
@ -213,8 +213,4 @@ describe Api::V1::IssuesController do
end
end
after(:all) do
User.destroy_all
Platform.destroy_all
end
end