From 71b0f8ea0b7d4460fdbb70ca9b61789d37ed4885 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 31 Mar 2013 17:08:10 +0300 Subject: Use existing methods for branch names: Ex use @repository.branch_names instead of @repository.heads.map(&:name) --- spec/models/project_spec.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'spec/models') 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 -- cgit v1.2.1