summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAdam Leonard <adamjamesleonard@gmail.com>2011-10-25 20:15:11 -0400
committerAdam Leonard <adamjamesleonard@gmail.com>2011-10-25 20:15:11 -0400
commit92f6de03703cb64fb5758c629a83522287af2d19 (patch)
tree7ffe6eacd1ad70f18d3e94120201eb5ba4818190 /spec
parent0955863489ee449389ec08afb498803bc6fbb59e (diff)
downloadgitlab-ce-92f6de03703cb64fb5758c629a83522287af2d19.tar.gz
If terms are removed show all results for current status
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/issues_spec.rb37
1 files changed, 31 insertions, 6 deletions
diff --git a/spec/requests/issues_spec.rb b/spec/requests/issues_spec.rb
index d3582d16794..b7f4d411287 100644
--- a/spec/requests/issues_spec.rb
+++ b/spec/requests/issues_spec.rb
@@ -149,21 +149,46 @@ describe "Issues" do
before do
['foobar', 'foobar2', 'gitlab'].each do |title|
@issue = Factory :issue,
- :author => @user,
+ :author => @user,
:assignee => @user,
- :project => project,
- :title => title
+ :project => project,
+ :title => title
@issue.save
end
end
- it "should search and return the correct results" do
+ it "should be able to search on different statuses" do
+ @issue = Issue.first
+ @issue.closed = true
+ @issue.save
+
visit project_issues_path(project)
- fill_in "issue_search", :with => "foobar"
+ choose 'closed_issues'
+ fill_in 'issue_search', :with => 'foobar'
+
+ page.should have_content 'foobar'
+ page.should_not have_content 'foobar2'
+ page.should_not have_content 'gitlab'
+ end
+
+ it "should search for term and return the correct results" do
+ visit project_issues_path(project)
+ fill_in 'issue_search', :with => 'foobar'
+
page.should have_content 'foobar'
page.should have_content 'foobar2'
page.should_not have_content 'gitlab'
end
- end
+ it "should return all results if term has been cleared" do
+ visit project_issues_path(project)
+ fill_in "issue_search", :with => "foobar"
+ # Because fill_in, :with => "" triggers nothing we need to trigger a keyup event
+ page.execute_script("$('.issue_search').val('').keyup();");
+
+ page.should have_content 'foobar'
+ page.should have_content 'foobar2'
+ page.should have_content 'gitlab'
+ end
+ end
end