Created
August 4, 2009 22:29
-
-
Save thoughtbot/162346 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HouseSearchTest < ActiveSupport::TestCase | |
should "build a new HouseSearch with the expected params" do | |
params = {'keyword' => 'some keyword', | |
'price' => '20-30'} | |
house_search = HouseSearch.new(params) | |
params.each do |field, value| | |
assert_equal value, house_search.send(field) | |
end | |
end | |
should "handle nil on #new" do | |
assert_nothing_raised do | |
search = HouseSearch.new(nil) | |
end | |
end | |
should "produce nil on #id" do | |
search = HouseSearch.new | |
assert_nil search.id | |
end | |
should "produce true on #new_record?" do | |
search = HouseSearch.new | |
assert search.new_record? | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment