diff options
Diffstat (limited to 'spec/views/groups/runners')
-rw-r--r-- | spec/views/groups/runners/_group_runners.html.haml_spec.rb | 42 | ||||
-rw-r--r-- | spec/views/groups/runners/_sort_dropdown.html.haml_spec.rb | 26 |
2 files changed, 0 insertions, 68 deletions
diff --git a/spec/views/groups/runners/_group_runners.html.haml_spec.rb b/spec/views/groups/runners/_group_runners.html.haml_spec.rb deleted file mode 100644 index 3a8686ab046..00000000000 --- a/spec/views/groups/runners/_group_runners.html.haml_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'groups/runners/group_runners.html.haml' do - describe 'render' do - let_it_be(:user) { create(:user) } - let_it_be(:group) { create(:group) } - - before do - @group = group - allow(view).to receive(:current_user).and_return(user) - allow(view).to receive(:reset_registration_token_group_settings_ci_cd_path).and_return('banana_url') - end - - context 'when group runner registration is allowed' do - before do - allow(view).to receive(:can?).with(user, :register_group_runners, group).and_return(true) - end - - it 'enables the Remove group button for a group' do - render 'groups/runners/group_runners', group: group - - expect(rendered).to have_selector '#js-install-runner' - expect(rendered).not_to have_content 'Please contact an admin to register runners.' - end - end - - context 'when group runner registration is not allowed' do - before do - allow(view).to receive(:can?).with(user, :register_group_runners, group).and_return(false) - end - - it 'does not enable the the Remove group button for a group' do - render 'groups/runners/group_runners', group: group - - expect(rendered).to have_content 'Please contact an admin to register runners.' - expect(rendered).not_to have_selector '#js-install-runner' - end - end - end -end diff --git a/spec/views/groups/runners/_sort_dropdown.html.haml_spec.rb b/spec/views/groups/runners/_sort_dropdown.html.haml_spec.rb deleted file mode 100644 index 5438fea85ee..00000000000 --- a/spec/views/groups/runners/_sort_dropdown.html.haml_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'groups/runners/sort_dropdown.html.haml' do - describe 'render' do - describe 'when a sort option is not selected' do - it 'renders a default sort option' do - render 'groups/runners/sort_dropdown' - - expect(rendered).to have_content _('Created date') - end - end - - describe 'when a sort option is selected' do - before do - assign(:sort, 'contacted_asc') - render 'groups/runners/sort_dropdown' - end - - it 'renders the selected sort option' do - expect(rendered).to have_content _('Last Contact') - end - end - end -end |