Skip to content
Snippets Groups Projects
Commit 80cf553a authored by Anna Vovchenko's avatar Anna Vovchenko Committed by Charlie Ablett
Browse files

Implemented suggestion changes after the BE review

parent 02e3bcc7
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -5,14 +5,6 @@ module ClustersHelper
clusterable.is_a?(Project)
end
 
def default_branch_name(clusterable)
return clusterable.default_branch if clusterable.is_a?(Project)
end
def clusterable_project_path(clusterable)
return clusterable.full_path if clusterable.is_a?(Project)
end
def js_clusters_list_data(clusterable)
{
ancestor_help_path: help_page_path('user/group/clusters/index', anchor: 'cluster-precedence'),
Loading
Loading
@@ -116,4 +108,14 @@ module ClustersHelper
def can_admin_cluster?(user, cluster)
can?(user, :admin_cluster, cluster)
end
private
def default_branch_name(clusterable)
return clusterable.default_branch if clusterable.is_a?(Project)
end
def clusterable_project_path(clusterable)
return clusterable.full_path if clusterable.is_a?(Project)
end
end
Loading
Loading
@@ -38,6 +38,11 @@ RSpec.describe ClustersHelper do
 
subject { helper.js_clusters_list_data(clusterable) }
 
before do
helper.send(:default_branch_name, clusterable)
helper.send(:clusterable_project_path, clusterable)
end
it 'displays endpoint path' do
expect(subject[:endpoint]).to eq("#{project_path(project)}/-/clusters.json")
end
Loading
Loading
@@ -124,6 +129,14 @@ RSpec.describe ClustersHelper do
it 'displays display_cluster_agents as false' do
expect(subject[:display_cluster_agents]).to eq("false")
end
it 'does not include a default branch' do
expect(subject[:default_branch_name]).to be_nil
end
it 'does not include a project path' do
expect(subject[:project_path]).to be_nil
end
end
 
describe 'certificate based clusters enabled' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment