diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-02-09 12:13:58 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-09 12:13:58 -0500 |
commit | 7ea60fbfc872e5acc0cc444d442958990747c6b3 (patch) | |
tree | bd4a38293d5d03b5cf3842fab04562fe8b775739 /features | |
parent | a52c5778bb9d95097cc965539731a2ef846c3ff0 (diff) | |
parent | 201fb4c7e3f9ab4265f87f548ae22bb4008015c9 (diff) | |
download | gitlab-ce-7ea60fbfc872e5acc0cc444d442958990747c6b3.tar.gz |
Merge remote-tracking branch 'dev/master' into 'master'
Diffstat (limited to 'features')
-rw-r--r-- | features/project/builds/permissions.feature | 35 | ||||
-rw-r--r-- | features/steps/project/builds/summary.rb | 8 | ||||
-rw-r--r-- | features/steps/shared/builds.rb | 17 | ||||
-rw-r--r-- | features/steps/shared/project.rb | 12 |
4 files changed, 64 insertions, 8 deletions
diff --git a/features/project/builds/permissions.feature b/features/project/builds/permissions.feature index 1193bcd74f6..3c7f72335d9 100644 --- a/features/project/builds/permissions.feature +++ b/features/project/builds/permissions.feature @@ -5,6 +5,41 @@ Feature: Project Builds Permissions And project has CI enabled And project has a recent build + Scenario: I try to visit build details as guest + Given I am member of a project with a guest role + When I visit recent build details page + Then page status code should be 404 + + Scenario: I try to visit project builds page as guest + Given I am member of a project with a guest role + When I visit project builds page + Then page status code should be 404 + + Scenario: I try to visit build details of internal project without access to builds + Given The project is internal + And public access for builds is disabled + When I visit recent build details page + Then page status code should be 404 + + Scenario: I try to visit internal project builds page without access to builds + Given The project is internal + And public access for builds is disabled + When I visit project builds page + Then page status code should be 404 + + Scenario: I try to visit build details of internal project with access to builds + Given The project is internal + And public access for builds is enabled + When I visit recent build details page + Then I see details of a build + And I see build trace + + Scenario: I try to visit internal project builds page with access to builds + Given The project is internal + And public access for builds is enabled + When I visit project builds page + Then I see the build + Scenario: I try to download build artifacts as guest Given I am member of a project with a guest role And recent build has artifacts available diff --git a/features/steps/project/builds/summary.rb b/features/steps/project/builds/summary.rb index 4bc670fdfcb..4f94fc96354 100644 --- a/features/steps/project/builds/summary.rb +++ b/features/steps/project/builds/summary.rb @@ -4,14 +4,6 @@ class Spinach::Features::ProjectBuildsSummary < Spinach::FeatureSteps include SharedBuilds include RepoHelpers - step 'I see details of a build' do - expect(page).to have_content "Build ##{@build.id}" - end - - step 'I see build trace' do - expect(page).to have_css '#build-trace' - end - step 'I see button to CI Lint' do page.within('.nav-controls') do ci_lint_tool_link = page.find_link('CI Lint') diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 92bf362879b..726e2e814ad 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -38,4 +38,21 @@ module SharedBuilds step 'I access artifacts download page' do visit download_namespace_project_build_artifacts_path(@project.namespace, @project, @build) end + + step 'I see details of a build' do + expect(page).to have_content "Build ##{@build.id}" + end + + step 'I see build trace' do + expect(page).to have_css '#build-trace' + end + + step 'I see the build' do + page.within('.commit_status') do + expect(page).to have_content "##{@build.id}" + expect(page).to have_content @build.sha[0..7] + expect(page).to have_content @build.ref + expect(page).to have_content @build.name + end + end end diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index d9c75d12238..b13e82f276b 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -240,6 +240,18 @@ module SharedProject end end + step 'The project is internal' do + @project.update(visibility_level: Gitlab::VisibilityLevel::INTERNAL) + end + + step 'public access for builds is enabled' do + @project.update(public_builds: true) + end + + step 'public access for builds is disabled' do + @project.update(public_builds: false) + end + def user_owns_project(user_name:, project_name:, visibility: :private) user = user_exists(user_name, username: user_name.gsub(/\s/, '').underscore) project = Project.find_by(name: project_name) |