diff options
Diffstat (limited to 'spec/controllers/projects/releases_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/releases_controller_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/controllers/projects/releases_controller_spec.rb b/spec/controllers/projects/releases_controller_spec.rb index c1f1373ddc2..fc7ab88bbe0 100644 --- a/spec/controllers/projects/releases_controller_spec.rb +++ b/spec/controllers/projects/releases_controller_spec.rb @@ -9,6 +9,7 @@ RSpec.describe Projects::ReleasesController do let_it_be(:private_project) { create(:project, :repository, :private) } let_it_be(:developer) { create(:user) } let_it_be(:reporter) { create(:user) } + let_it_be(:guest) { create(:user) } let_it_be(:user) { developer } let!(:release_1) { create(:release, project: project, released_at: Time.zone.parse('2018-10-18')) } let!(:release_2) { create(:release, project: project, released_at: Time.zone.parse('2019-10-19')) } @@ -16,6 +17,7 @@ RSpec.describe Projects::ReleasesController do before do project.add_developer(developer) project.add_reporter(reporter) + project.add_guest(guest) end shared_examples_for 'successful request' do @@ -199,6 +201,13 @@ RSpec.describe Projects::ReleasesController do it_behaves_like 'not found' end + + context 'when user is a guest' do + let(:project) { private_project } + let(:user) { guest } + + it_behaves_like 'not found' + end end # `GET #downloads` is addressed in spec/requests/projects/releases_controller_spec.rb |