blob: 83a837fba4471aef3e75642c09d16d04fe8e7c35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
require 'spec_helper'
feature 'User views files page', feature: true do
let(:user) { create(:user) }
let(:project) { create(:forked_project_with_submodules) }
before do
project.team << [user, :master]
gitlab_sign_in 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
|