summaryrefslogtreecommitdiff
path: root/spec/presenters
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-05-30 13:54:59 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2017-07-06 12:01:36 +0200
commitc63e3221587daf9e7464f7d2079ca8ed3111f6ff (patch)
tree386eb322d420d4ddf5a4bff514334f686b58c9fb /spec/presenters
parent050eae8c4dff87fef63e79eb60d927d0171b5f7b (diff)
downloadgitlab-ce-c63e3221587daf9e7464f7d2079ca8ed3111f6ff.tar.gz
Add many foreign keys to the projects table
This removes the need for relying on Rails' "dependent" option for data removal, which is _incredibly_ slow (even when using :delete_all) when deleting large amounts of data. This also ensures data consistency is enforced on DB level and not on application level (something Rails is really bad at). This commit also includes various migrations to add foreign keys to tables that eventually point to "projects" to ensure no rows get orphaned upon removing a project.
Diffstat (limited to 'spec/presenters')
-rw-r--r--spec/presenters/ci/build_presenter_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/presenters/ci/build_presenter_spec.rb b/spec/presenters/ci/build_presenter_spec.rb
index 518e97d17a1..f05d5c7fce5 100644
--- a/spec/presenters/ci/build_presenter_spec.rb
+++ b/spec/presenters/ci/build_presenter_spec.rb
@@ -85,7 +85,7 @@ describe Ci::BuildPresenter do
describe 'quack like a Ci::Build permission-wise' do
context 'user is not allowed' do
- let(:project) { build_stubbed(:empty_project, public_builds: false) }
+ let(:project) { create(:empty_project, public_builds: false) }
it 'returns false' do
expect(presenter.can?(nil, :read_build)).to be_falsy
@@ -93,7 +93,7 @@ describe Ci::BuildPresenter do
end
context 'user is allowed' do
- let(:project) { build_stubbed(:empty_project, :public) }
+ let(:project) { create(:empty_project, :public) }
it 'returns true' do
expect(presenter.can?(nil, :read_build)).to be_truthy