diff options
Diffstat (limited to 'spec/models/sidebars/projects/menus/project_overview/menu_items/releases_spec.rb')
-rw-r--r-- | spec/models/sidebars/projects/menus/project_overview/menu_items/releases_spec.rb | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/spec/models/sidebars/projects/menus/project_overview/menu_items/releases_spec.rb b/spec/models/sidebars/projects/menus/project_overview/menu_items/releases_spec.rb deleted file mode 100644 index db124c2252e..00000000000 --- a/spec/models/sidebars/projects/menus/project_overview/menu_items/releases_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Sidebars::Projects::Menus::ProjectOverview::MenuItems::Releases do - let_it_be(:project) { create(:project, :repository) } - - let(:user) { project.owner } - let(:context) { Sidebars::Projects::Context.new(current_user: user, container: project) } - - subject { described_class.new(context) } - - describe '#render?' do - context 'when project repository is empty' do - it 'returns false' do - allow(project).to receive(:empty_repo?).and_return(true) - - expect(subject.render?).to eq false - end - end - - context 'when project repository is not empty' do - context 'when user can read releases' do - it 'returns true' do - expect(subject.render?).to eq true - end - end - - context 'when user cannot read releases' do - let(:user) { nil } - - it 'returns false' do - expect(subject.render?).to eq false - end - end - end - end -end |