diff --git a/test/functional/friends_controller_test.rb b/test/functional/friends_controller_test.rb index b64101a..8c91193 100644 --- a/test/functional/friends_controller_test.rb +++ b/test/functional/friends_controller_test.rb @@ -80,25 +80,38 @@ class FriendsControllerTest < Test::Unit::TestCase assert_template 'invite' end - should 'actualy add invite' do + should 'actualy invite manually added addresses with name and e-mail' do assert_difference InviteFriend, :count, 1 do post :invite, :manual_import_addresses => "Test Name ", :import_from => "manual", :message => "click: ", :confirmation => 1 assert_redirected_to :action => 'index' end + end + should 'actually invite manually added address with only e-mail' do assert_difference InviteFriend, :count, 1 do post :invite, :manual_import_addresses => "test@test.com", :import_from => "manual", :message => "click: ", :confirmation => 1 assert_redirected_to :action => 'index' end + end + should 'actually invite manually added addresses with e-mail and other format' do assert_difference InviteFriend, :count, 1 do post :invite, :manual_import_addresses => "test@test.cz.com", :import_from => "manual", :message => "click: ", :confirmation => 1 assert_redirected_to :action => 'index' end + end + should 'actually invite manually added address with friend object' do assert_difference InviteFriend, :count, 1 do post :invite, :manual_import_addresses => "#{friend.name} <#{friend.email}>", :import_from => "manual", :message => "click: ", :confirmation => 1 assert_redirected_to :action => 'index' end end + + should 'actually invite more than one manually added addres' do + assert_difference InviteFriend, :count, 2 do + post :invite, :manual_import_addresses => "Some Friend \r\notherperson@bleble.net\r\n", :import_from => "manual", :message => "click: ", :confirmation => 1 + assert_redirected_to :action => 'index' + end + end end -- libgit2 0.21.2