Commit 4a137651ec0408699b9ad137ba8794429f524f32
1 parent
be817c53
Exists in
master
and in
4 other branches
Fix merge request closed filter. Fixed one more test
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
app/models/merge_request.rb
| ... | ... | @@ -66,6 +66,10 @@ class MergeRequest < ActiveRecord::Base |
| 66 | 66 | |
| 67 | 67 | scope :merged, -> { with_state(:merged) } |
| 68 | 68 | |
| 69 | + # Closed scope for merge request should return | |
| 70 | + # both merged and closed mr's | |
| 71 | + scope :closed, -> { with_states(:closed, :merged) } | |
| 72 | + | |
| 69 | 73 | class << self |
| 70 | 74 | def find_all_by_branch(branch_name) |
| 71 | 75 | where("source_branch LIKE :branch OR target_branch LIKE :branch", branch: branch_name) | ... | ... |
spec/features/notes_on_merge_requests_spec.rb
| ... | ... | @@ -136,7 +136,9 @@ describe "On a merge request diff", js: true, focus: true do |
| 136 | 136 | end |
| 137 | 137 | |
| 138 | 138 | it "should be removed when canceled" do |
| 139 | - first(".js-close-discussion-note-form").trigger("click") | |
| 139 | + within(".file form[rel$='4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185']") do | |
| 140 | + find(".js-close-discussion-note-form").trigger("click") | |
| 141 | + end | |
| 140 | 142 | |
| 141 | 143 | should have_no_css(".js-temp-notes-holder") |
| 142 | 144 | end | ... | ... |