diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2017-04-18 20:49:52 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-04-18 20:49:52 +0000 |
commit | c0ff8b6d961655da2a6fd97b392a97205e1179a7 (patch) | |
tree | 93a4365a01d71fbaf66141633e4192a1117d4260 /spec/views | |
parent | f88762a5f577fa620e77f38fb6812fe4ee53d237 (diff) | |
download | gitlab-ce-c0ff8b6d961655da2a6fd97b392a97205e1179a7.tar.gz |
Fix container registry navigation menu highlights
Diffstat (limited to 'spec/views')
-rw-r--r-- | spec/views/layouts/nav/_project.html.haml_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/views/layouts/nav/_project.html.haml_spec.rb b/spec/views/layouts/nav/_project.html.haml_spec.rb new file mode 100644 index 00000000000..fd1637ca91b --- /dev/null +++ b/spec/views/layouts/nav/_project.html.haml_spec.rb @@ -0,0 +1,37 @@ +require 'spec_helper' + +describe 'layouts/nav/_project' do + describe 'container registry tab' do + before do + stub_container_registry_config(enabled: true) + + assign(:project, create(:project)) + allow(view).to receive(:current_ref).and_return('master') + + allow(view).to receive(:can?).and_return(true) + allow(controller).to receive(:controller_name) + .and_return('repositories') + allow(controller).to receive(:controller_path) + .and_return('projects/registry/repositories') + end + + it 'has both Registry and Repository tabs' do + render + + expect(rendered).to have_text 'Repository' + expect(rendered).to have_text 'Registry' + end + + it 'highlights only one tab' do + render + + expect(rendered).to have_css('.active', count: 1) + end + + it 'highlights container registry tab only' do + render + + expect(rendered).to have_css('.active', text: 'Registry') + end + end +end |