Commit bf4619e7 authored by Illya Klymov's avatar Illya Klymov

Address reviewer comments

parent 42423500
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ForkNamespaceEntity do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let(:namespace) { create(:group_with_deletion_schedule, :with_avatar, description: 'test', marked_for_deletion_on: 1.day.ago) }
let(:entity) { described_class.new(namespace, current_user: user, project: project) }
subject(:json) { entity.as_json }
before do
stub_licensed_features(adjourned_deletion_for_projects_and_groups: true)
end
it 'exposes marked_for_deletion state' do
expect(json[:marked_for_deletion]).to eq true
end
end
......@@ -51,6 +51,11 @@ RSpec.describe ForkNamespaceEntity do
expect(json[:relative_path]).to eql polymorphic_path(namespace)
end
it 'exposes human readable permission level' do
namespace.add_developer(user)
expect(json[:permission]).to eql 'Developer'
end
it 'sets can_create_project to true when user can create projects in namespace' do
allow(user).to receive(:can?).with(:create_projects, namespace).and_return(true)
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe ForkNamespaceSerializer do
it 'represents WebIdeTerminalEntity entities' do
it 'represents ForkNamespaceEntity entities' do
expect(described_class.entity_class).to eq(ForkNamespaceEntity)
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment