diff options
author | Robert Speicher <rspeicher@gmail.com> | 2012-09-26 13:21:38 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-26 16:32:25 -0400 |
commit | 9f0e80591ab1f3c4967575574fed37754ef2403b (patch) | |
tree | 17e04d8a369fc8c9aae2242d3ff32e3b3e48eba3 /spec/roles | |
parent | e9bd45060e3c5198124b4cdad08a7a26f5e0408a (diff) | |
download | gitlab-ce-9f0e80591ab1f3c4967575574fed37754ef2403b.tar.gz |
Fix Repository role spec
Diffstat (limited to 'spec/roles')
-rw-r--r-- | spec/roles/repository_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/roles/repository_spec.rb b/spec/roles/repository_spec.rb index 0fda57a3e27..c4e0e9dec81 100644 --- a/spec/roles/repository_spec.rb +++ b/spec/roles/repository_spec.rb @@ -21,27 +21,27 @@ describe Project, "Repository" do end describe "#discover_default_branch" do - let(:master) { double(name: 'master') } - let(:stable) { double(name: 'stable') } + let(:master) { 'master' } + let(:stable) { 'stable' } it "returns 'master' when master exists" do - project.should_receive(:heads).and_return([stable, master]) + project.should_receive(:branches).at_least(:once).and_return([stable, master]) project.discover_default_branch.should == 'master' end it "returns non-master when master exists but default branch is set to something else" do project.default_branch = 'stable' - project.should_receive(:heads).and_return([stable, master]) + project.should_receive(:branches).at_least(:once).and_return([stable, master]) project.discover_default_branch.should == 'stable' end it "returns a non-master branch when only one exists" do - project.should_receive(:heads).and_return([stable]) + project.should_receive(:branches).at_least(:once).and_return([stable]) project.discover_default_branch.should == 'stable' end it "returns nil when no branch exists" do - project.should_receive(:heads).and_return([]) + project.should_receive(:branches).at_least(:once).and_return([]) project.discover_default_branch.should be_nil end end |