diff options
-rw-r--r-- | app/models/merge_request.rb | 4 | ||||
-rw-r--r-- | spec/features/notes_on_merge_requests_spec.rb | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 06aa9f3c9e0..1bc3428476e 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -66,6 +66,10 @@ class MergeRequest < ActiveRecord::Base scope :merged, -> { with_state(:merged) } + # Closed scope for merge request should return + # both merged and closed mr's + scope :closed, -> { with_states(:closed, :merged) } + class << self def find_all_by_branch(branch_name) where("source_branch LIKE :branch OR target_branch LIKE :branch", branch: branch_name) diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb index 06e18195df5..059e65f8cee 100644 --- a/spec/features/notes_on_merge_requests_spec.rb +++ b/spec/features/notes_on_merge_requests_spec.rb @@ -136,7 +136,9 @@ describe "On a merge request diff", js: true, focus: true do end it "should be removed when canceled" do - first(".js-close-discussion-note-form").trigger("click") + within(".file form[rel$='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185']") do + find(".js-close-discussion-note-form").trigger("click") + end should have_no_css(".js-temp-notes-holder") end |