diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2017-02-02 15:10:25 +0500 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2017-02-05 13:11:45 +0500 |
commit | 3deb66ea569cde62c3213b2671532c0db3c7263d (patch) | |
tree | 9e8085e752c20f28b711dd6a5920babb67cd6b07 /spec/requests | |
parent | 4d11903dcf818342c4bde1af198eac7a45460318 (diff) | |
download | gitlab-ce-3deb66ea569cde62c3213b2671532c0db3c7263d.tar.gz |
Add traits for ProjectFeatures to Project factory
https://gitlab.com/gitlab-org/gitlab-ce/issues/24007
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 2 | ||||
-rw-r--r-- | spec/requests/git_http_spec.rb | 12 |
2 files changed, 5 insertions, 9 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index 62f1b8d7ca2..834c83166c0 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -425,7 +425,7 @@ describe API::Issues, api: true do end it 'returns no issues when user has access to project but not issues' do - restricted_project = create(:empty_project, :public, issues_access_level: ProjectFeature::PRIVATE) + restricted_project = create(:empty_project, :public, :issues_private) create(:issue, project: restricted_project) get api("/projects/#{restricted_project.id}/issues", non_member) diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb index 4a16824de04..87786e85621 100644 --- a/spec/requests/git_http_spec.rb +++ b/spec/requests/git_http_spec.rb @@ -57,7 +57,7 @@ describe 'Git HTTP requests', lib: true do end context 'but the repo is disabled' do - let(:project) { create(:project, repository_access_level: ProjectFeature::DISABLED, wiki_access_level: ProjectFeature::ENABLED) } + let(:project) { create(:project, :repository_disabled, :wiki_enabled) } let(:wiki) { ProjectWiki.new(project) } let(:path) { "/#{wiki.repository.path_with_namespace}.git" } @@ -141,7 +141,7 @@ describe 'Git HTTP requests', lib: true do context 'when the repo is public' do context 'but the repo is disabled' do it 'does not allow to clone the repo' do - project = create(:project, :public, repository_access_level: ProjectFeature::DISABLED) + project = create(:project, :public, :repository_disabled) download("#{project.path_with_namespace}.git", {}) do |response| expect(response).to have_http_status(:unauthorized) @@ -151,7 +151,7 @@ describe 'Git HTTP requests', lib: true do context 'but the repo is enabled' do it 'allows to clone the repo' do - project = create(:project, :public, repository_access_level: ProjectFeature::ENABLED) + project = create(:project, :public, :repository_enabled) download("#{project.path_with_namespace}.git", {}) do |response| expect(response).to have_http_status(:ok) @@ -161,7 +161,7 @@ describe 'Git HTTP requests', lib: true do context 'but only project members are allowed' do it 'does not allow to clone the repo' do - project = create(:project, :public, repository_access_level: ProjectFeature::PRIVATE) + project = create(:project, :public, :repository_private) download("#{project.path_with_namespace}.git", {}) do |response| expect(response).to have_http_status(:unauthorized) @@ -360,10 +360,6 @@ describe 'Git HTTP requests', lib: true do let(:project) { build.project } let(:other_project) { create(:empty_project) } - before do - project.project_feature.update_attributes(builds_access_level: ProjectFeature::ENABLED) - end - context 'when build created by system is authenticated' do it "downloads get status 200" do clone_get "#{project.path_with_namespace}.git", user: 'gitlab-ci-token', password: build.token |