Commit b45ee013 authored by Axel García's avatar Axel García

Content-aware tests for RF CTA

parent 47367d39
...@@ -47,9 +47,22 @@ RSpec.describe 'admin/application_settings/general.html.haml' do ...@@ -47,9 +47,22 @@ RSpec.describe 'admin/application_settings/general.html.haml' do
render render
end end
it('renders registration features prompt') do it('renders registration features prompt without activation link') do
expect(rendered).to render_template('shared/_registration_features_discovery_message')
expect(rendered).to have_field('application_setting_disabled_repository_size_limit', disabled: true) expect(rendered).to have_field('application_setting_disabled_repository_size_limit', disabled: true)
expect(rendered).to have_link 'Registration Features Program'
expect(rendered).not_to have_link 'Enable Service Ping and register for this feature.'
end
context 'user has an active license' do
before do
assign(:license, create(:license))
render
end
it('renders registration features prompt with activation link') do
expect(rendered).to have_link 'Enable Service Ping and register for this feature.', href: metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings')
end
end end
end end
end end
......
...@@ -49,9 +49,22 @@ RSpec.describe 'projects/edit' do ...@@ -49,9 +49,22 @@ RSpec.describe 'projects/edit' do
render render
end end
it('renders registration features prompt') do it('renders registration features prompt without activation link') do
expect(rendered).to render_template('shared/_registration_features_discovery_message')
expect(rendered).to have_field('project_disabled_repository_size_limit', disabled: true) expect(rendered).to have_field('project_disabled_repository_size_limit', disabled: true)
expect(rendered).to have_link 'Registration Features Program'
expect(rendered).not_to have_link 'Enable Service Ping and register for this feature.'
end
context 'user has an active license' do
before do
assign(:license, create(:license))
render
end
it('renders registration features prompt with activation link') do
expect(rendered).to have_link 'Enable Service Ping and register for this feature.', href: metrics_and_profiling_admin_application_settings_path(anchor: 'js-usage-settings')
end
end end
end end
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