summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-31 17:08:10 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-03-31 17:08:10 +0300
commit71b0f8ea0b7d4460fdbb70ca9b61789d37ed4885 (patch)
tree0f2efb3aa1b7098f8a276da69030cd372df7f51f /spec/models
parent025e41576e9a394487598cf9a3ce31d0fb7867ef (diff)
downloadgitlab-ce-71b0f8ea0b7d4460fdbb70ca9b61789d37ed4885.tar.gz
Use existing methods for branch names: Ex use @repository.branch_names instead of @repository.heads.map(&:name)
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index e6585f78aa8..53388b933ee 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -233,7 +233,7 @@ describe Project do
it "should be true for projects with external issues tracker if issues enabled" do
ext_project.can_have_issues_tracker_id?.should be_true
- end
+ end
it "should be false for projects with internal issue tracker if issues enabled" do
project.can_have_issues_tracker_id?.should be_false
@@ -247,4 +247,15 @@ describe Project do
ext_project.can_have_issues_tracker_id?.should be_false
end
end
+
+ describe :open_branches do
+ let(:project) { create(:project) }
+
+ before do
+ project.protected_branches.create(name: 'master')
+ end
+
+ it { project.open_branches.map(&:name).should include('bootstrap') }
+ it { project.open_branches.map(&:name).should_not include('master') }
+ end
end