checks.rb 553 B

123456789101112131415161718192021
  1. # frozen_string_literal: true
  2. RSpec.shared_examples 'a check available to devops users' do
  3. describe 'skip?' do
  4. context 'when user can view devops' do
  5. before { allow(user).to receive(:can?).with(:view_devops).and_return(true) }
  6. it 'returns false' do
  7. expect(check.skip?).to be false
  8. end
  9. end
  10. context 'when user cannot view devops' do
  11. before { allow(user).to receive(:can?).with(:view_devops).and_return(false) }
  12. it 'returns true' do
  13. expect(check.skip?).to be true
  14. end
  15. end
  16. end
  17. end