Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-03-21 17:42:25 +0300
committerRobert Speicher <robert@gitlab.com>2016-03-21 17:42:25 +0300
commitffc3acd498e5cfeb98f6104421cba32acdd7ee64 (patch)
tree7127c4a4b0221703dce53948d8de48bb2dd152bc /spec/models/issue_spec.rb
parent3fca30d27f90a52bdbca746b1244c95e6c7db2d2 (diff)
parent75aaf91cb1d08c4350e2881b18118faf30e1f310 (diff)
Merge branch 'issues-show-performance' into 'master'
Improve performance of viewing individual issues This MR does two things: 1. `Issue#related_branches` no longer performs Git operations that aren't needed 2. The output of `Repository#exists?` is now cached and flushed properly Combined these two changes should further cut down the amount of Git operations performed when viewing individual issues (and possibly other pages). See merge request !3296
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r--spec/models/issue_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb
index 05e4233243d..8334545b759 100644
--- a/spec/models/issue_spec.rb
+++ b/spec/models/issue_spec.rb
@@ -183,9 +183,9 @@ describe Issue, models: true do
describe '#related_branches' do
it "selects the right branches" do
allow(subject.project.repository).to receive(:branch_names).
- and_return(["mpempe", "#{subject.iid}mepmep", subject.to_branch_name])
+ and_return(["mpempe", "#{subject.iid}mepmep", subject.to_branch_name])
- expect(subject.related_branches).to eq [subject.to_branch_name]
+ expect(subject.related_branches).to eq([subject.to_branch_name])
end
end