diff options
author | Phil Hughes <me@iamphill.com> | 2016-10-03 16:24:00 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-10-03 16:24:00 +0100 |
commit | 735731a565e593fa8df445b3bb2ac2f768fb1fae (patch) | |
tree | 1ab382c8b2a14c5c0ee89d12ddf08daef9ec8eea | |
parent | cc88fa4d5be9ec0d5fb42f1bb5efa0b82f30a589 (diff) | |
download | gitlab-ce-735731a565e593fa8df445b3bb2ac2f768fb1fae.tar.gz |
Tests update
-rw-r--r-- | app/views/shared/issuable/_label_dropdown.html.haml | 2 | ||||
-rw-r--r-- | spec/features/issues/filter_issues_spec.rb | 19 |
2 files changed, 14 insertions, 7 deletions
diff --git a/app/views/shared/issuable/_label_dropdown.html.haml b/app/views/shared/issuable/_label_dropdown.html.haml index d537fd6712a..92d5cb307ae 100644 --- a/app/views/shared/issuable/_label_dropdown.html.haml +++ b/app/views/shared/issuable/_label_dropdown.html.haml @@ -15,7 +15,7 @@ - if selected - selected.each do |label| - = hidden_field_tag data_options[:field_name], use_id ? label.try(:id) : u(label.try(:title)), id: nil + = hidden_field_tag data_options[:field_name], use_id ? label.try(:id) : label.try(:title), id: nil .dropdown %button.dropdown-menu-toggle.js-label-select.js-multiselect{class: classes.join(' '), type: "button", data: dropdown_data} diff --git a/spec/features/issues/filter_issues_spec.rb b/spec/features/issues/filter_issues_spec.rb index 32aaa0f1037..78208aed46d 100644 --- a/spec/features/issues/filter_issues_spec.rb +++ b/spec/features/issues/filter_issues_spec.rb @@ -110,30 +110,37 @@ describe 'Filter issues', feature: true do end it "filters by `won't fix` and another label" do - find('.dropdown-menu-labels a', text: label.title).click page.within '.labels-filter' do - expect(page).to have_content wontfix.title click_link wontfix.title + expect(page).to have_content wontfix.title + click_link label.title end - expect(find('.js-label-select .dropdown-toggle-text')).to have_content(wontfix.title) + expect(find('.js-label-select .dropdown-toggle-text')).to have_content("#{wontfix.title} +1 more") end it "filters by `won't fix` label followed by another label after page load" do - find('.dropdown-menu-labels a', text: wontfix.title).click - # Close label dropdown to load + page.within '.labels-filter' do + click_link wontfix.title + expect(page).to have_content wontfix.title + end + find('body').click + expect(find('.filtered-labels')).to have_content(wontfix.title) find('.js-label-select').click wait_for_ajax find('.dropdown-menu-labels a', text: label.title).click - # Close label dropdown to load + find('body').click + + expect(find('.filtered-labels')).to have_content(wontfix.title) expect(find('.filtered-labels')).to have_content(label.title) find('.js-label-select').click wait_for_ajax + expect(find('.dropdown-menu-labels li', text: wontfix.title)).to have_css('.is-active') expect(find('.dropdown-menu-labels li', text: label.title)).to have_css('.is-active') end |