diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 15:05:58 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-21 15:05:58 +0000 |
commit | ad1e4b8fb8104b642fa79ed34fd144bc2bed8a19 (patch) | |
tree | 78f95d63d4ea5ed0b1a8b3c83c38d9cbd682f884 /spec/views/projects/tree | |
parent | 664c4c7b49c6056136299817eb79e9f1de83e567 (diff) | |
download | gitlab-ce-ad1e4b8fb8104b642fa79ed34fd144bc2bed8a19.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/views/projects/tree')
-rw-r--r-- | spec/views/projects/tree/show.html.haml_spec.rb | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/spec/views/projects/tree/show.html.haml_spec.rb b/spec/views/projects/tree/show.html.haml_spec.rb index 960cf42a793..4307d1b49c9 100644 --- a/spec/views/projects/tree/show.html.haml_spec.rb +++ b/spec/views/projects/tree/show.html.haml_spec.rb @@ -7,6 +7,10 @@ describe 'projects/tree/show' do let(:project) { create(:project, :repository) } let(:repository) { project.repository } + let(:ref) { 'master' } + let(:commit) { repository.commit(ref) } + let(:path) { '' } + let(:tree) { repository.tree(commit.id, path) } before do stub_feature_flags(vue_file_list: false) @@ -19,26 +23,45 @@ describe 'projects/tree/show' do allow(view).to receive(:can_collaborate_with_project?).and_return(true) allow(view).to receive_message_chain('user_access.can_push_to_branch?').and_return(true) allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings) + allow(view).to receive(:current_user).and_return(project.creator) + + assign(:id, File.join(ref, path)) + assign(:ref, ref) + assign(:path, path) + assign(:last_commit, commit) + assign(:tree, tree) end context 'for branch names ending on .json' do let(:ref) { 'ends-with.json' } - let(:commit) { repository.commit(ref) } - let(:path) { '' } - let(:tree) { repository.tree(commit.id, path) } - - before do - assign(:id, File.join(ref, path)) - assign(:ref, ref) - assign(:path, path) - assign(:last_commit, commit) - assign(:tree, tree) - end it 'displays correctly' do render + expect(rendered).to have_css('.js-project-refs-dropdown .dropdown-toggle-text', text: ref) expect(rendered).to have_css('.readme-holder') end end + + context 'commit signatures' do + context 'with vue tree view disabled' do + it 'rendered via js-signature-container' do + render + + expect(rendered).to have_css('.js-signature-container') + end + end + + context 'with vue tree view enabled' do + before do + stub_feature_flags(vue_file_list: true) + end + + it 'are not rendered via js-signature-container' do + render + + expect(rendered).not_to have_css('.js-signature-container') + end + end + end end |