diff options
author | Clement Ho <ClemMakesApps@gmail.com> | 2016-12-16 01:08:07 -0600 |
---|---|---|
committer | Clement Ho <ClemMakesApps@gmail.com> | 2017-01-09 16:01:32 -0600 |
commit | fd90a99639f5685aa86440aba1da6165b623e877 (patch) | |
tree | 752d929a253122e9a68e4bd5bb0f1055bbd74b68 /spec | |
parent | 625ecdbcc848f05eafaf167255901efd2d32cb37 (diff) | |
download | gitlab-ce-fd90a99639f5685aa86440aba1da6165b623e877.tar.gz |
Define filtered_search as a variable
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/issues/filtered_search/dropdown_hint_spec.rb | 1 | ||||
-rw-r--r-- | spec/features/issues/filtered_search/search_bar_spec.rb | 7 |
2 files changed, 2 insertions, 6 deletions
diff --git a/spec/features/issues/filtered_search/dropdown_hint_spec.rb b/spec/features/issues/filtered_search/dropdown_hint_spec.rb index 364d4bf4db1..216cd78850b 100644 --- a/spec/features/issues/filtered_search/dropdown_hint_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_hint_spec.rb @@ -6,6 +6,7 @@ describe 'Dropdown hint', js: true, feature: true do let!(:project) { create(:empty_project) } let!(:user) { create(:user) } let(:filtered_search) { find('.filtered-search') } + before do project.team << [user, :master] login_as(user) diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb index 5862214cdc3..d37057a44f8 100644 --- a/spec/features/issues/filtered_search/search_bar_spec.rb +++ b/spec/features/issues/filtered_search/search_bar_spec.rb @@ -5,6 +5,7 @@ describe 'Search bar', js: true, feature: true do let!(:project) { create(:empty_project) } let!(:user) { create(:user) } + let(:filtered_search) { find('.filtered-search') } before do project.team << [user, :master] @@ -22,7 +23,6 @@ describe 'Search bar', js: true, feature: true do describe 'clear search button' do it 'clears text' do search_text = 'search_text' - filtered_search = find('.filtered-search') filtered_search.set(search_text) expect(filtered_search.value).to eq(search_text) @@ -35,28 +35,24 @@ describe 'Search bar', js: true, feature: true do end it 'hides after clicked' do - filtered_search = find('.filtered-search') filtered_search.set('a') find('.filtered-search-input-container .clear-search').click expect(page).to have_css('.clear-search', visible: false) end it 'hides when there is no text' do - filtered_search = find('.filtered-search') filtered_search.set('a') filtered_search.set('') expect(page).to have_css('.clear-search', visible: false) end it 'shows when there is text' do - filtered_search = find('.filtered-search') filtered_search.set('a') expect(page).to have_css('.clear-search', visible: true) end it 'resets the dropdown hint filter' do - filtered_search = find('.filtered-search') filtered_search.click(); original_size = page.all('#js-dropdown-hint .filter-dropdown .filter-dropdown-item').size @@ -69,7 +65,6 @@ describe 'Search bar', js: true, feature: true do end it 'resets the dropdown filters' do - filtered_search = find('.filtered-search') filtered_search.set('a') hintStyle = page.find('#js-dropdown-hint')['style'] hintOffset = getLeftStyle(hintStyle) |