-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract specs for devops users in checks to shared example
- Loading branch information
1 parent
62d9670
commit f7cae42
Showing
5 changed files
with
25 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
shared_examples 'a check available to devops users' do | ||
describe 'skip?' do | ||
context 'when user can view devops' do | ||
before { allow(user).to receive(:can?).with(:view_devops).and_return(true) } | ||
|
||
it 'returns false' do | ||
expect(check.skip?).to be false | ||
end | ||
end | ||
|
||
context 'when user cannot view devops' do | ||
before { allow(user).to receive(:can?).with(:view_devops).and_return(false) } | ||
|
||
it 'returns true' do | ||
expect(check.skip?).to be true | ||
end | ||
end | ||
end | ||
end |