Commit 18dd86b6 authored by Robert Speicher's avatar Robert Speicher

Remove more redundant specs in filter_issues_spec

We were essentially testing "all of the filters" four times, so now we
just do it once at the top level.
parent f70a56f0
...@@ -67,36 +67,34 @@ describe 'Filter issues', js: true do ...@@ -67,36 +67,34 @@ describe 'Filter issues', js: true do
visit project_issues_path(project) visit project_issues_path(project)
end end
describe 'filter issues by author' do it 'filters by all available tokens' do
context 'only author' do
it 'filters issues by searched author' do
input_filtered_search("author:@#{user.username}")
wait_for_requests
expect_tokens([author_token(user.name)])
expect_issues_list_count(5)
expect_filtered_search_input_empty
end
end
context 'author with other filters' do
it 'filters issues by searched author, assignee, label, milestone and text' do
search_term = 'issue' search_term = 'issue'
input_filtered_search("author:@#{user.username} assignee:@#{user.username} label:~#{caps_sensitive_label.title} milestone:%#{milestone.title} #{search_term}") input_filtered_search("assignee:@#{user.username} author:@#{user.username} label:~#{caps_sensitive_label.title} milestone:%#{milestone.title} #{search_term}")
wait_for_requests wait_for_requests
expect_tokens([ expect_tokens([
author_token(user.name),
assignee_token(user.name), assignee_token(user.name),
author_token(user.name),
label_token(caps_sensitive_label.title), label_token(caps_sensitive_label.title),
milestone_token(milestone.title) milestone_token(milestone.title)
]) ])
expect_issues_list_count(1) expect_issues_list_count(1)
expect_filtered_search_input(search_term) expect_filtered_search_input(search_term)
end end
describe 'filter issues by author' do
context 'only author' do
it 'filters issues by searched author' do
input_filtered_search("author:@#{user.username}")
wait_for_requests
expect_tokens([author_token(user.name)])
expect_issues_list_count(5)
expect_filtered_search_input_empty
end
end end
end end
...@@ -120,23 +118,6 @@ describe 'Filter issues', js: true do ...@@ -120,23 +118,6 @@ describe 'Filter issues', js: true do
expect_filtered_search_input_empty expect_filtered_search_input_empty
end end
end end
context 'assignee with other filters' do
it 'filters issues by searched assignee, author, label, milestone and text' do
search_term = 'searchTerm'
input_filtered_search("assignee:@#{user.username} author:@#{user.username} label:~#{caps_sensitive_label.title} milestone:%#{milestone.title} #{search_term}")
expect_tokens([
assignee_token(user.name),
author_token(user.name),
label_token(caps_sensitive_label.title),
milestone_token(milestone.title)
])
expect_issues_list_count(1)
expect_filtered_search_input(search_term)
end
end
end end
describe 'filter issues by label' do describe 'filter issues by label' do
...@@ -249,23 +230,6 @@ describe 'Filter issues', js: true do ...@@ -249,23 +230,6 @@ describe 'Filter issues', js: true do
end end
end end
context 'label with other filters' do
it 'filters issues by searched label, author, assignee, milestone and text' do
search_term = 'bug'
input_filtered_search("label:~#{caps_sensitive_label.title} author:@#{user.username} assignee:@#{user.username} milestone:%#{milestone.title} #{search_term}")
expect_tokens([
label_token(caps_sensitive_label.title),
author_token(user.name),
assignee_token(user.name),
milestone_token(milestone.title)
])
expect_issues_list_count(1)
expect_filtered_search_input(search_term)
end
end
context 'multiple labels with other filters' do context 'multiple labels with other filters' do
it 'filters issues by searched label, label2, author, assignee, milestone and text' do it 'filters issues by searched label, label2, author, assignee, milestone and text' do
search_term = 'bug' search_term = 'bug'
...@@ -361,25 +325,6 @@ describe 'Filter issues', js: true do ...@@ -361,25 +325,6 @@ describe 'Filter issues', js: true do
expect_filtered_search_input_empty expect_filtered_search_input_empty
end end
end end
context 'milestone with other filters' do
it 'filters issues by searched milestone, author, assignee, label and text' do
search_term = 'bug'
input_filtered_search("milestone:%#{milestone.title} author:@#{user.username} assignee:@#{user.username} label:~#{bug_label.title} #{search_term}")
wait_for_requests
expect_tokens([
milestone_token(milestone.title),
author_token(user.name),
assignee_token(user.name),
label_token(bug_label.title)
])
expect_issues_list_count(2)
expect_filtered_search_input(search_term)
end
end
end end
describe 'filter issues by text' do describe 'filter issues by text' do
......
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