gitlabhq/spec/roles/repository_spec.rb
Robert Speicher a463353773 Add "empty_repo?" method to Repository role
Replaces two calls that this method simplifies
2012-09-04 12:05:21 -04:00

23 lines
626 B
Ruby

require 'spec_helper'
describe Project, "Repository" do
let(:project) { build(:project) }
describe "#empty_repo?" do
it "should return true if the repo doesn't exist" do
project.stub(repo_exists?: false, has_commits?: true)
project.should be_empty_repo
end
it "should return true if the repo has commits" do
project.stub(repo_exists?: true, has_commits?: false)
project.should be_empty_repo
end
it "should return false if the repo exists and has commits" do
project.stub(repo_exists?: true, has_commits?: true)
project.should_not be_empty_repo
end
end
end