diff options
Diffstat (limited to 'spec/services/projects/fork_service_spec.rb')
-rw-r--r-- | spec/services/projects/fork_service_spec.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/spec/services/projects/fork_service_spec.rb b/spec/services/projects/fork_service_spec.rb index 5c80345c2b3..e55a2e3f8a0 100644 --- a/spec/services/projects/fork_service_spec.rb +++ b/spec/services/projects/fork_service_spec.rb @@ -16,18 +16,18 @@ describe Projects::ForkService do describe "successfully creates project in the user namespace" do let(:to_project) { fork_project(@from_project, @to_user) } - it { to_project.owner.should == @to_user } - it { to_project.namespace.should == @to_user.namespace } - it { to_project.star_count.should be_zero } - it { to_project.description.should == @from_project.description } + it { expect(to_project.owner).to eq(@to_user) } + it { expect(to_project.namespace).to eq(@to_user.namespace) } + it { expect(to_project.star_count).to be_zero } + it { expect(to_project.description).to eq(@from_project.description) } end end context 'fork project failure' do it "fails due to transaction failure" do @to_project = fork_project(@from_project, @to_user, false) - @to_project.errors.should_not be_empty - @to_project.errors[:base].should include("Fork transaction failed.") + expect(@to_project.errors).not_to be_empty + expect(@to_project.errors[:base]).to include("Fork transaction failed.") end end @@ -35,9 +35,9 @@ describe Projects::ForkService do it "should fail due to validation, not transaction failure" do @existing_project = create(:project, creator_id: @to_user.id, name: @from_project.name, namespace: @to_namespace) @to_project = fork_project(@from_project, @to_user) - @existing_project.persisted?.should be_true - @to_project.errors[:base].should include("Invalid fork destination") - @to_project.errors[:base].should_not include("Fork transaction failed.") + expect(@existing_project.persisted?).to be_truthy + expect(@to_project.errors[:base]).to include("Invalid fork destination") + expect(@to_project.errors[:base]).not_to include("Fork transaction failed.") end end end @@ -58,19 +58,19 @@ describe Projects::ForkService do context 'fork project for group' do it 'group owner successfully forks project into the group' do to_project = fork_project(@project, @group_owner, true, @opts) - to_project.owner.should == @group - to_project.namespace.should == @group - to_project.name.should == @project.name - to_project.path.should == @project.path - to_project.description.should == @project.description - to_project.star_count.should be_zero + expect(to_project.owner).to eq(@group) + expect(to_project.namespace).to eq(@group) + expect(to_project.name).to eq(@project.name) + expect(to_project.path).to eq(@project.path) + expect(to_project.description).to eq(@project.description) + expect(to_project.star_count).to be_zero end end context 'fork project for group when user not owner' do it 'group developer should fail to fork project into the group' do to_project = fork_project(@project, @developer, true, @opts) - to_project.errors[:namespace].should == ['insufficient access rights'] + expect(to_project.errors[:namespace]).to eq(['insufficient access rights']) end end @@ -79,10 +79,10 @@ describe Projects::ForkService do existing_project = create(:project, name: @project.name, namespace: @group) to_project = fork_project(@project, @group_owner, true, @opts) - existing_project.persisted?.should be_true - to_project.errors[:base].should == ['Invalid fork destination'] - to_project.errors[:name].should == ['has already been taken'] - to_project.errors[:path].should == ['has already been taken'] + expect(existing_project.persisted?).to be_truthy + expect(to_project.errors[:base]).to eq(['Invalid fork destination']) + expect(to_project.errors[:name]).to eq(['has already been taken']) + expect(to_project.errors[:path]).to eq(['has already been taken']) end end end |