diff options
author | Heinrich Lee Yu <heinrich@gitlab.com> | 2019-08-07 18:45:23 +0300 |
---|---|---|
committer | Clement Ho <408677-ClemMakesApps@users.noreply.gitlab.com> | 2019-08-07 18:45:23 +0300 |
commit | b689ddd9b6d7ebed2f4d014a77ee223df2d3491b (patch) | |
tree | c8b0d42bb5d7ab104f7727ef9462b1ec8c96f362 /spec/support/shared_examples/controllers | |
parent | af2edf28259ff1c236af346cfa6c62092afe7391 (diff) |
Do not persist notes filter when auto-switching
Send a `persist_filter: false` param to backend when
opening links to notes and auto-switching to show
all notes
Diffstat (limited to 'spec/support/shared_examples/controllers')
-rw-r--r-- | spec/support/shared_examples/controllers/issuable_notes_filter_shared_examples.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/support/shared_examples/controllers/issuable_notes_filter_shared_examples.rb b/spec/support/shared_examples/controllers/issuable_notes_filter_shared_examples.rb index fb22498f84f..26ed86bfe26 100644 --- a/spec/support/shared_examples/controllers/issuable_notes_filter_shared_examples.rb +++ b/spec/support/shared_examples/controllers/issuable_notes_filter_shared_examples.rb @@ -41,7 +41,15 @@ shared_examples 'issuable notes filter' do get :discussions, params: params.merge(notes_filter: notes_filter) - expect(user.reload.notes_filter_for(issuable)).to eq(0) + expect(user.reload.notes_filter_for(issuable)).to eq(UserPreference::NOTES_FILTERS[:all_notes]) + end + + it 'does not set notes filter when persist_filter param is false' do + notes_filter = UserPreference::NOTES_FILTERS[:only_comments] + + get :discussions, params: params.merge(notes_filter: notes_filter, persist_filter: false) + + expect(user.reload.notes_filter_for(issuable)).to eq(UserPreference::NOTES_FILTERS[:all_notes]) end it 'returns only user comments' do |