Skip to content
Snippets Groups Projects
Commit 0cd94c0f authored by Douwe Maan's avatar Douwe Maan
Browse files

Merge branch '29-fix-specs-after-changes-in-gitlab-test' into 'master'

Fix specs after change to gitlab-test to account for new branch

Also, when verifying the last commit on master search for the branch by name, instead of counting on it being the last branch, to be more resilient to future changes on gitlab-test

Closes #29

See merge request !130
parents e9cf661b 4da2ca31
No related branches found
No related tags found
1 merge request!130Fix specs after change to gitlab-test to account for new branch
Pipeline #
Loading
Loading
@@ -19,10 +19,11 @@ describe Gitlab::Git::Branch do
it { expect(branch.target.sha).to eq("0b4bc9a49b562e85de7cc9e834518ea6828729b9") }
end
 
describe 'last branch' do
let(:branch) { repository.branches.last }
describe 'master branch' do
let(:branch) do
repository.branches.find { |branch| branch.name == 'master' }
end
 
it { expect(branch.name).to eq(SeedRepo::Repo::BRANCHES.last) }
it { expect(branch.target.sha).to eq(SeedRepo::LastCommit::ID) }
end
 
Loading
Loading
Loading
Loading
@@ -469,7 +469,8 @@ describe Gitlab::Git::Repository do
 
it "should have as many entries as branches and tags" do
expected_refs = SeedRepo::Repo::BRANCHES + SeedRepo::Repo::TAGS
expect(refs.size).to eq(expected_refs.size)
# We flatten in case a commit is pointed at by more than one branch and/or tag
expect(refs.values.flatten.size).to eq(expected_refs.size)
end
end
 
Loading
Loading
module SeedRepo
module Repo
HEAD = "master"
BRANCHES = ["feature", "fix", "fix-blob-path", "fix-existing-submodule-dir", "fix-mode", "gitattributes", "gitattributes-updated", "master"]
TAGS = ["v1.0.0", 'v1.1.0', 'v1.2.0', 'v1.2.1']
BRANCHES = %w(
feature fix fix-blob-path fix-existing-submodule-dir fix-mode gitattributes
gitattributes-updated master merge-test
)
TAGS = %w(v1.0.0 v1.1.0 v1.2.0 v1.2.1)
end
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment