debian-mirror-gitlab/spec/lib/gitlab/gl_repository_spec.rb

20 lines
626 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
require 'spec_helper'
describe ::Gitlab::GlRepository do
describe '.parse' do
2017-09-10 17:25:29 +05:30
set(:project) { create(:project, :repository) }
2017-08-17 22:00:37 +05:30
it 'parses a project gl_repository' do
2019-05-18 00:54:41 +05:30
expect(described_class.parse("project-#{project.id}")).to eq([project, Gitlab::GlRepository::PROJECT])
2017-08-17 22:00:37 +05:30
end
it 'parses a wiki gl_repository' do
2019-05-18 00:54:41 +05:30
expect(described_class.parse("wiki-#{project.id}")).to eq([project, Gitlab::GlRepository::WIKI])
2017-08-17 22:00:37 +05:30
end
it 'throws an argument error on an invalid gl_repository' do
expect { described_class.parse("badformat-#{project.id}") }.to raise_error(ArgumentError)
end
end
end