diff options
Diffstat (limited to 'spec/support/shared_examples/features/snippets_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/features/snippets_shared_examples.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/support/shared_examples/features/snippets_shared_examples.rb b/spec/support/shared_examples/features/snippets_shared_examples.rb index 5c35617bd36..1c8a9714bdf 100644 --- a/spec/support/shared_examples/features/snippets_shared_examples.rb +++ b/spec/support/shared_examples/features/snippets_shared_examples.rb @@ -18,3 +18,35 @@ RSpec.shared_examples 'paginated snippets' do |remote: false| end end end + +RSpec.shared_examples 'tabs with counts' do + let(:tabs) { page.all('.snippet-scope-menu li') } + + it 'shows a tab for All snippets and count' do + tab = tabs[0] + + expect(tab.text).to include('All') + expect(tab.find('.badge').text).to eq(counts[:all]) + end + + it 'shows a tab for Private snippets and count' do + tab = tabs[1] + + expect(tab.text).to include('Private') + expect(tab.find('.badge').text).to eq(counts[:private]) + end + + it 'shows a tab for Internal snippets and count' do + tab = tabs[2] + + expect(tab.text).to include('Internal') + expect(tab.find('.badge').text).to eq(counts[:internal]) + end + + it 'shows a tab for Public snippets and count' do + tab = tabs[3] + + expect(tab.text).to include('Public') + expect(tab.find('.badge').text).to eq(counts[:public]) + end +end |