parent
6615428679
commit
f33fe50f0d
3 changed files with 39 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
Please view this file on the master branch, on stable branches it's out of date.
|
Please view this file on the master branch, on stable branches it's out of date.
|
||||||
|
|
||||||
v 7.14.0 (unreleased)
|
v 7.14.0 (unreleased)
|
||||||
|
- Disable internal issue tracker controller if external tracker is used (Stan Hu)
|
||||||
- Expire Rails cache entries after two weeks to prevent endless Redis growth
|
- Expire Rails cache entries after two weeks to prevent endless Redis growth
|
||||||
- Add support for destroying project milestones (Stan Hu)
|
- Add support for destroying project milestones (Stan Hu)
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ class Projects::IssuesController < Projects::ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def module_enabled
|
def module_enabled
|
||||||
return render_404 unless @project.issues_enabled
|
return render_404 unless @project.issues_enabled && @project.default_issues_tracker?
|
||||||
end
|
end
|
||||||
|
|
||||||
# Since iids are implemented only in 6.1
|
# Since iids are implemented only in 6.1
|
||||||
|
|
37
spec/controllers/projects/issues_controller_spec.rb
Normal file
37
spec/controllers/projects/issues_controller_spec.rb
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
require('spec_helper')
|
||||||
|
|
||||||
|
describe Projects::IssuesController do
|
||||||
|
let(:project) { create(:project) }
|
||||||
|
let(:user) { create(:user) }
|
||||||
|
let(:issue) { create(:issue, project: project) }
|
||||||
|
|
||||||
|
before do
|
||||||
|
sign_in(user)
|
||||||
|
project.team << [user, :developer]
|
||||||
|
controller.instance_variable_set(:@project, project)
|
||||||
|
end
|
||||||
|
|
||||||
|
describe "GET #index" do
|
||||||
|
it "returns index" do
|
||||||
|
get :index, namespace_id: project.namespace.id, project_id: project.id
|
||||||
|
|
||||||
|
expect(response.status).to eq(200)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "returns 404 when issues are disabled" do
|
||||||
|
project.issues_enabled = false
|
||||||
|
project.save
|
||||||
|
|
||||||
|
get :index, namespace_id: project.namespace.id, project_id: project.id
|
||||||
|
expect(response.status).to eq(404)
|
||||||
|
end
|
||||||
|
|
||||||
|
it "returns 404 when external issue tracker is enabled" do
|
||||||
|
allow(project).to receive(:default_issues_tracker?).and_return(false)
|
||||||
|
|
||||||
|
get :index, namespace_id: project.namespace.id, project_id: project.id
|
||||||
|
expect(response.status).to eq(404)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue