diff options
Diffstat (limited to 'spec/services/create_commit_service_spec.rb')
-rw-r--r-- | spec/services/create_commit_service_spec.rb | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/spec/services/create_commit_service_spec.rb b/spec/services/create_commit_service_spec.rb index 05793eb..209e088 100644 --- a/spec/services/create_commit_service_spec.rb +++ b/spec/services/create_commit_service_spec.rb @@ -16,11 +16,11 @@ describe CreateCommitService do ) end - it { commit.should be_kind_of(Commit) } - it { commit.should be_valid } - it { commit.should be_persisted } - it { commit.should eq project.commits.last } - it { commit.builds.first.should be_kind_of(Build) } + it { expect(commit).to be_kind_of(Commit) } + it { expect(commit).to be_valid } + it { expect(commit).to be_persisted } + it { expect(commit).to eq project.commits.last } + it { expect(commit.builds.first).to be_kind_of(Build) } end context "skip tag if there is no build for it" do @@ -32,7 +32,7 @@ describe CreateCommitService do ci_yaml_file: gitlab_ci_yaml, commits: [ { message: "Message" } ] ) - result.should be_persisted + expect(result).to be_persisted end it "creates commit if there is no appropriate job but deploy job has right ref setting" do @@ -45,7 +45,7 @@ describe CreateCommitService do ci_yaml_file: config, commits: [ { message: "Message" } ] ) - result.should be_persisted + expect(result).to be_persisted end end @@ -59,8 +59,8 @@ describe CreateCommitService do commits: commits, ci_yaml_file: gitlab_ci_yaml ) - commit.builds.any?.should be_falsey - commit.status.should eq "skipped" + expect(commit.builds.any?).to be_falsey + expect(commit.status).to eq "skipped" end it "does not skips builds creation if there is no [ci skip] tag in commit message" do @@ -74,7 +74,7 @@ describe CreateCommitService do ci_yaml_file: gitlab_ci_yaml ) - commit.builds.first.name.should eq "staging" + expect(commit.builds.first.name).to eq "staging" end it "skips builds creation if there is [ci skip] tag in commit message and yaml is invalid" do @@ -86,8 +86,8 @@ describe CreateCommitService do commits: commits, ci_yaml_file: "invalid: file" ) - commit.builds.any?.should be_falsey - commit.status.should eq "skipped" + expect(commit.builds.any?).to be_falsey + expect(commit.status).to eq "skipped" end end @@ -100,7 +100,7 @@ describe CreateCommitService do commits: commits, ci_yaml_file: gitlab_ci_yaml ) - commit.builds.count(:all).should eq 2 + expect(commit.builds.count(:all)).to eq 2 commit = service.execute(project, ref: 'refs/heads/master', @@ -109,7 +109,7 @@ describe CreateCommitService do commits: commits, ci_yaml_file: gitlab_ci_yaml ) - commit.builds.count(:all).should eq 2 + expect(commit.builds.count(:all)).to eq 2 end it "creates commit with failed status if yaml is invalid" do @@ -123,8 +123,8 @@ describe CreateCommitService do ci_yaml_file: "invalid: file" ) - commit.status.should eq "failed" - commit.builds.any?.should be_falsey + expect(commit.status).to eq "failed" + expect(commit.builds.any?).to be_falsey end end end |