Skip to content

Commit

Permalink
Adding username search tests
Browse files Browse the repository at this point in the history
  • Loading branch information
carols10cents committed Sep 10, 2011
1 parent 9919dde commit 80ce43b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/acceptance/user_search_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require 'require_relative' if RUBY_VERSION[0,3] == '1.8'
require_relative 'acceptance_helper'

describe "user search" do
include AcceptanceHelper

it "can search for users" do
zebra = Factory(:user, :username => "zebra")

visit "/users"
fill_in "search", :with => "zebra"
click_button "Search"

assert has_content?("zebra")
end

it "gets a nice message if there are no users matching the search" do
visit "/users?search=nonexistentusername"
assert has_content?("Sorry, no users that match.")
end
end

0 comments on commit 80ce43b

Please sign in to comment.