Commit 6bff207d authored by Francesco Levorato's avatar Francesco Levorato

Refactor spec to go through ApplicationController#project

parent 69cb5fba
......@@ -8,12 +8,11 @@ describe Projects::IssuesController do
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
get :index, namespace_id: project.namespace.path, project_id: project.path
expect(response.status).to eq(200)
end
......@@ -22,14 +21,15 @@ describe Projects::IssuesController do
project.issues_enabled = false
project.save
get :index, namespace_id: project.namespace.id, project_id: project.id
get :index, namespace_id: project.namespace.path, project_id: project.path
expect(response.status).to eq(404)
end
it "returns 404 when external issue tracker is enabled" do
controller.instance_variable_set(:@project, project)
allow(project).to receive(:default_issues_tracker?).and_return(false)
get :index, namespace_id: project.namespace.id, project_id: project.id
get :index, namespace_id: project.namespace.path, project_id: project.path
expect(response.status).to eq(404)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment