diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-08-09 18:45:25 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-08-09 18:45:25 -0500 |
commit | 3f0737384251501a95bdb601e90592cfd08bc0bc (patch) | |
tree | 99d3d9bbfc0ea99bd6c23d0841e9f651137a4f99 /spec/features | |
parent | c36362969155669b3455e96eb408313f7284f180 (diff) | |
parent | 8abc757539454e13835073318f896796b1a85faf (diff) | |
download | gitlab-ce-3f0737384251501a95bdb601e90592cfd08bc0bc.tar.gz |
Merge branch 'adambuckland/gitlab-ce-19727-sort-submodules-with-files'
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/files/files_sort_submodules_with_folders_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb new file mode 100644 index 00000000000..10b91d8990b --- /dev/null +++ b/spec/features/projects/files/files_sort_submodules_with_folders_spec.rb @@ -0,0 +1,29 @@ +require 'spec_helper' + +feature 'User views files page', feature: true do + include WaitForAjax + + let(:user) { create(:user) } + let(:project) { create(:forked_project_with_submodules) } + + before do + project.team << [user, :master] + login_as user + visit namespace_project_tree_path(project.namespace, project, project.repository.root_ref) + end + + scenario 'user sees folders and submodules sorted together, followed by files' do + rows = all('td.tree-item-file-name').map(&:text) + tree = project.repository.tree + + folders = tree.trees.map(&:name) + files = tree.blobs.map(&:name) + submodules = tree.submodules.map do |submodule| + submodule.name + " @ " + submodule.id[0..7] + end + + sorted_titles = (folders + submodules).sort + files + + expect(rows).to eq(sorted_titles) + end +end |