diff options
author | Stan Hu <stanhu@gmail.com> | 2015-11-26 10:11:35 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-11-26 10:11:35 +0300 |
commit | 2497d3d550dc0d4e095c8c3fe75d4452fb163252 (patch) | |
tree | b22985b99bfe8189d58f502ab3a0f33f28b7fda8 /spec/controllers | |
parent | dee28c50a90acaf1a364d3971132c70c96493932 (diff) |
Fix 404 in redirection after removing a project
Closes https://github.com/gitlabhq/gitlabhq/issues/9844
Closes #3559
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects_controller_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 4bb47c6b025..665526fde93 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -88,6 +88,22 @@ describe ProjectsController do end end + describe "#destroy" do + let(:admin) { create(:admin) } + + it "redirects to the dashboard" do + controller.instance_variable_set(:@project, project) + sign_in(admin) + + orig_id = project.id + delete :destroy, namespace_id: project.namespace.path, id: project.path + + expect { Project.find(orig_id) }.to raise_error(ActiveRecord::RecordNotFound) + expect(response.status).to eq(302) + expect(response).to redirect_to(dashboard_projects_path) + end + end + describe "POST #toggle_star" do it "toggles star if user is signed in" do sign_in(user) |