Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-11-30 20:00:13 +0300
committerRobert Speicher <rspeicher@gmail.com>2015-11-30 20:00:13 +0300
commit244c9a00e05963fe7cc21a9dd8abf1d4ec1be078 (patch)
tree8699dc956bffa27a0a0973b5fde44f0eff1b2cc8 /spec
parente0131c5d07f22681e4118473dbfa0dd93df12b28 (diff)
parent2497d3d550dc0d4e095c8c3fe75d4452fb163252 (diff)
Merge branch 'stanhu/gitlab-ce-fix-404-after-project-removal'
See merge request !1916
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects_controller_spec.rb16
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)