diff options
author | Robert Speicher <rspeicher@gmail.com> | 2014-03-19 03:55:59 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2014-03-19 03:57:38 -0400 |
commit | a90574fab290233225375b1c9e9c232b0e540b52 (patch) | |
tree | 6036defb08fefd2af9ceab98ca6dfb287941cb2a /spec/finders | |
parent | 53d3294d1de6a3ded84532c1874ca48910fd69b0 (diff) | |
download | gitlab-ce-a90574fab290233225375b1c9e9c232b0e540b52.tar.gz |
Speed up finders/merge_requests_finder_spec
Uses the :simple merge request factory trait introduced by d166e70; cuts
execution time of this spec in half.
Diffstat (limited to 'spec/finders')
-rw-r--r-- | spec/finders/merge_requests_finder_spec.rb | 18 |
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) |