diff options
author | Felipe Artur <felipefac@gmail.com> | 2016-08-02 01:31:21 +0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2016-09-01 17:47:59 +0300 |
commit | 892dea67717c0efbd6a28f7639f34535ec0a8747 (patch) | |
tree | 83191c811b58de808da77f51aed63a1a021b2dcb /spec/requests/api/projects_spec.rb | |
parent | e71cd7a300017cf85e16de3b1c68fdb25c3a4b4d (diff) |
Project tools visibility level
Diffstat (limited to 'spec/requests/api/projects_spec.rb')
-rw-r--r-- | spec/requests/api/projects_spec.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb index 63f2467be63..28aa56e8644 100644 --- a/spec/requests/api/projects_spec.rb +++ b/spec/requests/api/projects_spec.rb @@ -73,7 +73,7 @@ describe API::API, api: true do end it 'does not include open_issues_count' do - project.update_attributes( { issues_enabled: false } ) + project.project_feature.update_attribute(:issues_access_level, ProjectFeature::DISABLED) get api('/projects', user) expect(response.status).to eq 200 @@ -231,8 +231,15 @@ describe API::API, api: true do post api('/projects', user), project project.each_pair do |k, v| + next if %i{ issues_enabled merge_requests_enabled wiki_enabled }.include?(k) expect(json_response[k.to_s]).to eq(v) end + + # Check feature permissions attributes + project = Project.find_by_path(project[:path]) + expect(project.project_feature.issues_access_level).to eq(ProjectFeature::DISABLED) + expect(project.project_feature.merge_requests_access_level).to eq(ProjectFeature::DISABLED) + expect(project.project_feature.wiki_access_level).to eq(ProjectFeature::DISABLED) end it 'sets a project as public' do |