summaryrefslogtreecommitdiff
path: root/spec/finders
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-19 14:45:15 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-19 14:45:15 +0200
commit492dc82ced619206aeed7e3aaae393d85a4d3f40 (patch)
treefb2f4006ab826a663a6a3f5c960e6286420f48c3 /spec/finders
parent587e16a4e3d171cfcf477388ca1e5c8c95c8c018 (diff)
parenta90574fab290233225375b1c9e9c232b0e540b52 (diff)
downloadgitlab-ce-492dc82ced619206aeed7e3aaae393d85a4d3f40.tar.gz
Merge pull request #6557 from tsigo/faster-merge-request-features
Speed up features/notes_on_merge_requests_spec
Diffstat (limited to 'spec/finders')
-rw-r--r--spec/finders/merge_requests_finder_spec.rb18
1 files changed, 7 insertions, 11 deletions
diff --git a/spec/finders/merge_requests_finder_spec.rb b/spec/finders/merge_requests_finder_spec.rb
index 76f9e753dd2..0bd2ccafcc1 100644
--- a/spec/finders/merge_requests_finder_spec.rb
+++ b/spec/finders/merge_requests_finder_spec.rb
@@ -1,13 +1,15 @@
require 'spec_helper'
describe MergeRequestsFinder do
- let(:user) { create :user }
+ let(:user) { create :user }
let(:user2) { create :user }
+
let(:project1) { create(:project) }
let(:project2) { create(:project) }
- let(:merge_request1) { create(:merge_request, author: user, source_project: project1, target_project: project2) }
- let(:merge_request2) { create(:merge_request, author: user, source_project: project2, target_project: project1) }
- let(:merge_request3) { create(:merge_request, author: user, source_project: project2, target_project: project2) }
+
+ let!(:merge_request1) { create(:merge_request, :simple, author: user, source_project: project1, target_project: project2) }
+ let!(:merge_request2) { create(:merge_request, :simple, author: user, source_project: project2, target_project: project1) }
+ let!(:merge_request3) { create(:merge_request, :simple, author: user, source_project: project2, target_project: project2) }
before do
project1.team << [user, :master]
@@ -15,13 +17,7 @@ describe MergeRequestsFinder do
project2.team << [user2, :developer]
end
- describe :execute do
- before :each do
- merge_request1
- merge_request2
- merge_request3
- end
-
+ describe "#execute" do
it 'should filter by scope' do
params = { scope: 'authored', state: 'opened' }
merge_requests = MergeRequestsFinder.new.execute(user, params)