blob: bc26403b7f4607c703baf6195138885c156007d4 (
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
require 'spec_helper'
describe ProjectTransferService do
before(:each) { enable_observers }
after(:each) {disable_observers}
context 'namespace -> namespace' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let(:project) { create(:project, namespace: user.namespace) }
before do
@result = service.transfer(project, group)
end
it { @result.should be_true }
it { project.namespace.should == group }
end
context 'namespace -> no namespace' do
let(:user) { create(:user) }
let(:project) { create(:project, namespace: user.namespace) }
before do
@result = service.transfer(project, nil)
end
it { @result.should be_true }
it { project.namespace.should == nil }
end
context 'no namespace -> namespace' do
let(:project) { create(:project) }
let(:user) { create(:user) }
before do
@result = service.transfer(project, user.namespace)
end
it { @result.should be_true }
it { project.namespace.should == user.namespace }
end
def service
service = ProjectTransferService.new
service.gitlab_shell.stub(mv_repository: true)
service
end
end
|