Commit 4a137651 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix merge request closed filter. Fixed one more test

parent be817c53
...@@ -66,6 +66,10 @@ class MergeRequest < ActiveRecord::Base ...@@ -66,6 +66,10 @@ class MergeRequest < ActiveRecord::Base
scope :merged, -> { with_state(:merged) } 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 class << self
def find_all_by_branch(branch_name) def find_all_by_branch(branch_name)
where("source_branch LIKE :branch OR target_branch LIKE :branch", branch: branch_name) where("source_branch LIKE :branch OR target_branch LIKE :branch", branch: branch_name)
......
...@@ -136,7 +136,9 @@ describe "On a merge request diff", js: true, focus: true do ...@@ -136,7 +136,9 @@ describe "On a merge request diff", js: true, focus: true do
end end
it "should be removed when canceled" do 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") should have_no_css(".js-temp-notes-holder")
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment