Fix and add specs for Issue#to_reference
This commit is contained in:
parent
1c749880e5
commit
78c8bce1ff
|
@ -27,7 +27,11 @@ describe Issue, models: true do
|
||||||
let(:issue) { build(:issue, iid: 1, project: project) }
|
let(:issue) { build(:issue, iid: 1, project: project) }
|
||||||
|
|
||||||
it 'returns a String reference to the object' do
|
it 'returns a String reference to the object' do
|
||||||
expect(issue.to_reference).to eq "#1"
|
expect(issue.to_reference).to eq "#{project.namespace.name}/sample-project#1"
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'supports a project reference' do
|
||||||
|
expect(issue.to_reference(project)).to eq "#1"
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns a String reference with the full path' do
|
it 'returns a String reference with the full path' do
|
||||||
|
@ -38,6 +42,11 @@ describe Issue, models: true do
|
||||||
another_project = build(:empty_project, name: 'another-project', namespace: project.namespace)
|
another_project = build(:empty_project, name: 'another-project', namespace: project.namespace)
|
||||||
expect(issue.to_reference(another_project)).to eq "sample-project#1"
|
expect(issue.to_reference(another_project)).to eq "sample-project#1"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'supports a group reference' do
|
||||||
|
group = build(:group, name: 'sample-group')
|
||||||
|
expect(issue.to_reference(nil, group)).to eq("sample-project#1")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#is_being_reassigned?' do
|
describe '#is_being_reassigned?' do
|
||||||
|
|
Loading…
Reference in New Issue