Update bundle (with newest rubocop version) and fix offenses
This commit is contained in:
@ -10,7 +10,7 @@ describe FileTree do
|
||||
|
||||
context 'with a media file' do
|
||||
context 'with an audio file' do
|
||||
let(:file) { FactoryBot.build(:file, file_type: FactoryBot.build(:dot_mp3)) }
|
||||
let(:file) { build(:file, file_type: build(:dot_mp3)) }
|
||||
|
||||
it 'is an audio file icon' do
|
||||
expect(file_icon).to include('fa-file-audio-o')
|
||||
@ -18,7 +18,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
context 'with an image file' do
|
||||
let(:file) { FactoryBot.build(:file, file_type: FactoryBot.build(:dot_jpg)) }
|
||||
let(:file) { build(:file, file_type: build(:dot_jpg)) }
|
||||
|
||||
it 'is an image file icon' do
|
||||
expect(file_icon).to include('fa-file-image-o')
|
||||
@ -26,7 +26,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
context 'with a video file' do
|
||||
let(:file) { FactoryBot.build(:file, file_type: FactoryBot.build(:dot_mp4)) }
|
||||
let(:file) { build(:file, file_type: build(:dot_mp4)) }
|
||||
|
||||
it 'is a video file icon' do
|
||||
expect(file_icon).to include('fa-file-video-o')
|
||||
@ -36,7 +36,7 @@ describe FileTree do
|
||||
|
||||
context 'with other files' do
|
||||
context 'with a read-only file' do
|
||||
let(:file) { FactoryBot.build(:file, read_only: true) }
|
||||
let(:file) { build(:file, read_only: true) }
|
||||
|
||||
it 'is a lock icon' do
|
||||
expect(file_icon).to include('fa-lock')
|
||||
@ -44,7 +44,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
context 'with an executable file' do
|
||||
let(:file) { FactoryBot.build(:file, file_type: FactoryBot.build(:dot_py)) }
|
||||
let(:file) { build(:file, file_type: build(:dot_py)) }
|
||||
|
||||
it 'is a code file icon' do
|
||||
expect(file_icon).to include('fa-file-code-o')
|
||||
@ -52,7 +52,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
context 'with a renderable file' do
|
||||
let(:file) { FactoryBot.build(:file, file_type: FactoryBot.build(:dot_svg)) }
|
||||
let(:file) { build(:file, file_type: build(:dot_svg)) }
|
||||
|
||||
it 'is a text file icon' do
|
||||
expect(file_icon).to include('fa-file-text-o')
|
||||
@ -60,7 +60,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
context 'with all other files' do
|
||||
let(:file) { FactoryBot.build(:file, file_type: FactoryBot.build(:dot_md)) }
|
||||
let(:file) { build(:file, file_type: build(:dot_md)) }
|
||||
|
||||
it 'is a generic file icon' do
|
||||
expect(file_icon).to include('fa-file-o')
|
||||
@ -77,7 +77,7 @@ describe FileTree do
|
||||
|
||||
describe '#initialize' do
|
||||
let(:file_tree) { described_class.new(files) }
|
||||
let(:files) { FactoryBot.build_list(:file, 10, context: nil, path: 'foo/bar/baz') }
|
||||
let(:files) { build_list(:file, 10, context: nil, path: 'foo/bar/baz') }
|
||||
|
||||
it 'creates a root node' do
|
||||
# Instead of checking #initialize on the parent, we validate #set_as_root!
|
||||
@ -95,7 +95,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
describe '#map_to_js_tree' do
|
||||
let(:file) { FactoryBot.build(:file) }
|
||||
let(:file) { build(:file) }
|
||||
let(:js_tree) { file_tree.send(:map_to_js_tree, node) }
|
||||
let!(:leaf) { root.add(Tree::TreeNode.new('', file)) }
|
||||
let(:root) { Tree::TreeNode.new('', file) }
|
||||
@ -186,7 +186,7 @@ describe FileTree do
|
||||
end
|
||||
|
||||
context 'with files' do
|
||||
let(:files) { FactoryBot.build_list(:file, 10, context: nil, path: 'foo/bar/baz') }
|
||||
let(:files) { build_list(:file, 10, context: nil, path: 'foo/bar/baz') }
|
||||
let(:file_tree) { described_class.new(files) }
|
||||
let(:js_tree) { file_tree.to_js_tree }
|
||||
|
||||
|
Reference in New Issue
Block a user