summaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
commit39aa7132ceed3d4beab3a9b828e571bbfc67c07e (patch)
tree6c88289c9f99be0af8635636fcdf64102090e5ec /test/functional
parent5ad8203ce4f1bfea997960d0b52c626dea24b944 (diff)
parent6f69c1a85055ec7c2515719d79d2a7a4e60cec50 (diff)
Merge branch 'develop'5.1-beta1
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/call_forwards_controller_test.rb12
-rw-r--r--test/functional/call_routes_controller_test.rb49
-rw-r--r--test/functional/conference_invitees_controller_test.rb2
-rw-r--r--test/functional/conferences_controller_test.rb2
-rw-r--r--test/functional/gateway_parameters_controller_test.rb49
-rw-r--r--test/functional/gateway_settings_controller_test.rb49
-rw-r--r--test/functional/gateways_controller_test.rb49
-rw-r--r--test/functional/gemeinschaft_setups_controller_test.rb4
-rw-r--r--test/functional/gs_parameters_controller_test.rb49
-rw-r--r--test/functional/manufacturers_controller_test.rb8
-rw-r--r--test/functional/page_controller_test.rb8
-rw-r--r--test/functional/phone_book_entries_controller_test.rb4
-rw-r--r--test/functional/phone_books_controller_test.rb10
-rw-r--r--test/functional/phone_models_controller_test.rb12
-rw-r--r--test/functional/phone_number_ranges_controller_test.rb2
-rw-r--r--test/functional/phone_numbers_controller_test.rb8
-rw-r--r--test/functional/phones_controller_test.rb4
-rw-r--r--test/functional/phones_sip_accounts_controller_test.rb2
-rw-r--r--test/functional/route_elements_controller_test.rb49
-rw-r--r--test/functional/sip_accounts_controller_test.rb8
-rw-r--r--test/functional/sip_domains_controller_test.rb4
-rw-r--r--test/functional/tenants_controller_test.rb4
-rw-r--r--test/functional/trigger_controller_test.rb14
-rw-r--r--test/functional/user_groups_controller_test.rb4
-rw-r--r--test/functional/users_controller_test.rb6
25 files changed, 360 insertions, 52 deletions
diff --git a/test/functional/call_forwards_controller_test.rb b/test/functional/call_forwards_controller_test.rb
index 0993623..da8e6c9 100644
--- a/test/functional/call_forwards_controller_test.rb
+++ b/test/functional/call_forwards_controller_test.rb
@@ -3,27 +3,27 @@ require 'test_helper'
class CallForwardsControllerTest < ActionController::TestCase
setup do
- @user = Factory.create(:user)
+ @user = FactoryGirl.create(:user)
- #@tenant = Factory.create(:tenant)
+ #@tenant = FactoryGirl.create(:tenant)
#@tenant.tenant_memberships.create(:user_id => @user.id)
#@user.update_attributes!(:current_tenant_id => @tenant.id)
- @sip_account = Factory.create(
+ @sip_account = FactoryGirl.create(
:sip_account,
:sip_accountable => @user,
)
@user.sip_accounts << @sip_account
@sip_account = @user.sip_accounts.last
- @phone_number = Factory.create(
+ @phone_number = FactoryGirl.create(
:phone_number,
:phone_numberable => @sip_account,
)
@sip_account.phone_numbers << @phone_number
@phone_number = @sip_account.phone_numbers.last
- @call_forward = Factory.create(
+ @call_forward = FactoryGirl.create(
:call_forward,
:phone_number => @phone_number,
)
@@ -50,7 +50,7 @@ class CallForwardsControllerTest < ActionController::TestCase
# assert_difference('CallForward.count') do
# post :create,
# :phone_number_id => @phone_number.to_param,
-# :call_forward => Factory.attributes_for(
+# :call_forward => FactoryGirl.attributes_for(
# :call_forward
# )
# end
diff --git a/test/functional/call_routes_controller_test.rb b/test/functional/call_routes_controller_test.rb
new file mode 100644
index 0000000..77c0b2a
--- /dev/null
+++ b/test/functional/call_routes_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class CallRoutesControllerTest < ActionController::TestCase
+ setup do
+ @call_route = call_routes(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:call_routes)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create call_route" do
+ assert_difference('CallRoute.count') do
+ post :create, call_route: @call_route.attributes
+ end
+
+ assert_redirected_to call_route_path(assigns(:call_route))
+ end
+
+ test "should show call_route" do
+ get :show, id: @call_route.to_param
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @call_route.to_param
+ assert_response :success
+ end
+
+ test "should update call_route" do
+ put :update, id: @call_route.to_param, call_route: @call_route.attributes
+ assert_redirected_to call_route_path(assigns(:call_route))
+ end
+
+ test "should destroy call_route" do
+ assert_difference('CallRoute.count', -1) do
+ delete :destroy, id: @call_route.to_param
+ end
+
+ assert_redirected_to call_routes_path
+ end
+end
diff --git a/test/functional/conference_invitees_controller_test.rb b/test/functional/conference_invitees_controller_test.rb
index 72d2e2c..8ac5479 100644
--- a/test/functional/conference_invitees_controller_test.rb
+++ b/test/functional/conference_invitees_controller_test.rb
@@ -3,7 +3,7 @@ require 'test_helper'
class ConferenceInviteesControllerTest < ActionController::TestCase
setup do
- @conference_invitee = Factory.create(:conference_invitee)
+ @conference_invitee = FactoryGirl.create(:conference_invitee)
end
# test "should get index" do
diff --git a/test/functional/conferences_controller_test.rb b/test/functional/conferences_controller_test.rb
index 954838b..0f2d007 100644
--- a/test/functional/conferences_controller_test.rb
+++ b/test/functional/conferences_controller_test.rb
@@ -3,7 +3,7 @@ require 'test_helper'
class ConferencesControllerTest < ActionController::TestCase
setup do
- @conference = Factory.create(:conference)
+ @conference = FactoryGirl.create(:conference)
end
# test "should get index" do
diff --git a/test/functional/gateway_parameters_controller_test.rb b/test/functional/gateway_parameters_controller_test.rb
new file mode 100644
index 0000000..6f6ce40
--- /dev/null
+++ b/test/functional/gateway_parameters_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class GatewayParametersControllerTest < ActionController::TestCase
+ setup do
+ @gateway_parameter = gateway_parameters(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:gateway_parameters)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create gateway_parameter" do
+ assert_difference('GatewayParameter.count') do
+ post :create, gateway_parameter: @gateway_parameter.attributes
+ end
+
+ assert_redirected_to gateway_parameter_path(assigns(:gateway_parameter))
+ end
+
+ test "should show gateway_parameter" do
+ get :show, id: @gateway_parameter.to_param
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @gateway_parameter.to_param
+ assert_response :success
+ end
+
+ test "should update gateway_parameter" do
+ put :update, id: @gateway_parameter.to_param, gateway_parameter: @gateway_parameter.attributes
+ assert_redirected_to gateway_parameter_path(assigns(:gateway_parameter))
+ end
+
+ test "should destroy gateway_parameter" do
+ assert_difference('GatewayParameter.count', -1) do
+ delete :destroy, id: @gateway_parameter.to_param
+ end
+
+ assert_redirected_to gateway_parameters_path
+ end
+end
diff --git a/test/functional/gateway_settings_controller_test.rb b/test/functional/gateway_settings_controller_test.rb
new file mode 100644
index 0000000..c416528
--- /dev/null
+++ b/test/functional/gateway_settings_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class GatewaySettingsControllerTest < ActionController::TestCase
+ setup do
+ @gateway_setting = gateway_settings(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:gateway_settings)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create gateway_setting" do
+ assert_difference('GatewaySetting.count') do
+ post :create, gateway_setting: @gateway_setting.attributes
+ end
+
+ assert_redirected_to gateway_setting_path(assigns(:gateway_setting))
+ end
+
+ test "should show gateway_setting" do
+ get :show, id: @gateway_setting.to_param
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @gateway_setting.to_param
+ assert_response :success
+ end
+
+ test "should update gateway_setting" do
+ put :update, id: @gateway_setting.to_param, gateway_setting: @gateway_setting.attributes
+ assert_redirected_to gateway_setting_path(assigns(:gateway_setting))
+ end
+
+ test "should destroy gateway_setting" do
+ assert_difference('GatewaySetting.count', -1) do
+ delete :destroy, id: @gateway_setting.to_param
+ end
+
+ assert_redirected_to gateway_settings_path
+ end
+end
diff --git a/test/functional/gateways_controller_test.rb b/test/functional/gateways_controller_test.rb
new file mode 100644
index 0000000..e0928dd
--- /dev/null
+++ b/test/functional/gateways_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class GatewaysControllerTest < ActionController::TestCase
+ setup do
+ @gateway = gateways(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:gateways)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create gateway" do
+ assert_difference('Gateway.count') do
+ post :create, gateway: @gateway.attributes
+ end
+
+ assert_redirected_to gateway_path(assigns(:gateway))
+ end
+
+ test "should show gateway" do
+ get :show, id: @gateway.to_param
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @gateway.to_param
+ assert_response :success
+ end
+
+ test "should update gateway" do
+ put :update, id: @gateway.to_param, gateway: @gateway.attributes
+ assert_redirected_to gateway_path(assigns(:gateway))
+ end
+
+ test "should destroy gateway" do
+ assert_difference('Gateway.count', -1) do
+ delete :destroy, id: @gateway.to_param
+ end
+
+ assert_redirected_to gateways_path
+ end
+end
diff --git a/test/functional/gemeinschaft_setups_controller_test.rb b/test/functional/gemeinschaft_setups_controller_test.rb
index b23a878..5e6cadf 100644
--- a/test/functional/gemeinschaft_setups_controller_test.rb
+++ b/test/functional/gemeinschaft_setups_controller_test.rb
@@ -3,7 +3,7 @@ require 'test_helper'
class GemeinschaftSetupsControllerTest < ActionController::TestCase
setup do
- @gemeinschaft_setup = Factory.build(:gemeinschaft_setup)
+ @gemeinschaft_setup = FactoryGirl.build(:gemeinschaft_setup)
end
# test "should get index" do
@@ -20,7 +20,7 @@ class GemeinschaftSetupsControllerTest < ActionController::TestCase
# test "should create gemeinschaft_setup" do
# assert_difference('GemeinschaftSetup.count') do
# post :create,
-# gemeinschaft_setup: Factory.attributes_for(:gemeinschaft_setup)
+# gemeinschaft_setup: FactoryGirl.attributes_for(:gemeinschaft_setup)
# end
# assert_redirected_to gemeinschaft_setup_path(assigns(:gemeinschaft_setup))
# end
diff --git a/test/functional/gs_parameters_controller_test.rb b/test/functional/gs_parameters_controller_test.rb
new file mode 100644
index 0000000..a0e498a
--- /dev/null
+++ b/test/functional/gs_parameters_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class GsParametersControllerTest < ActionController::TestCase
+ setup do
+ @gs_parameter = gs_parameters(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:gs_parameters)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create gs_parameter" do
+ assert_difference('GsParameter.count') do
+ post :create, gs_parameter: @gs_parameter.attributes
+ end
+
+ assert_redirected_to gs_parameter_path(assigns(:gs_parameter))
+ end
+
+ test "should show gs_parameter" do
+ get :show, id: @gs_parameter.to_param
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @gs_parameter.to_param
+ assert_response :success
+ end
+
+ test "should update gs_parameter" do
+ put :update, id: @gs_parameter.to_param, gs_parameter: @gs_parameter.attributes
+ assert_redirected_to gs_parameter_path(assigns(:gs_parameter))
+ end
+
+ test "should destroy gs_parameter" do
+ assert_difference('GsParameter.count', -1) do
+ delete :destroy, id: @gs_parameter.to_param
+ end
+
+ assert_redirected_to gs_parameters_path
+ end
+end
diff --git a/test/functional/manufacturers_controller_test.rb b/test/functional/manufacturers_controller_test.rb
index dad38e5..0b10f6d 100644
--- a/test/functional/manufacturers_controller_test.rb
+++ b/test/functional/manufacturers_controller_test.rb
@@ -2,14 +2,14 @@ require 'test_helper'
class ManufacturersControllerTest < ActionController::TestCase
setup do
- @tenant = Factory.create(:tenant)
- @user = Factory.create(:user)
+ @tenant = FactoryGirl.create(:tenant)
+ @user = FactoryGirl.create(:user)
@tenant.tenant_memberships.create(:user_id => @user.id)
@user.update_attributes!(:current_tenant_id => @tenant.id)
- @manufacturer = Factory.create(:manufacturer)
+ @manufacturer = FactoryGirl.create(:manufacturer)
@expected_status_if_not_authorized = :redirect
end
@@ -46,7 +46,7 @@ class ManufacturersControllerTest < ActionController::TestCase
#
# test "should create manufacturer" do
# assert_difference('Manufacturer.count') do
- # post :create, manufacturer: Factory.build(:manufacturer).attributes
+ # post :create, manufacturer: FactoryGirl.build(:manufacturer).attributes
# end
#
# assert_redirected_to manufacturer_path(assigns(:manufacturer))
diff --git a/test/functional/page_controller_test.rb b/test/functional/page_controller_test.rb
index a5ae5ad..2bc1b80 100644
--- a/test/functional/page_controller_test.rb
+++ b/test/functional/page_controller_test.rb
@@ -11,8 +11,8 @@ class PageControllerTest < ActionController::TestCase
test "a logged in user should get index" do
- @tenant = Factory.create(:tenant)
- @user = Factory.create(:user)
+ @tenant = FactoryGirl.create(:tenant)
+ @user = FactoryGirl.create(:user)
@tenant.users << @user
@@ -22,8 +22,8 @@ class PageControllerTest < ActionController::TestCase
end
test "a logged out user should be redirected to the login" do
- @tenant = Factory.create(:tenant)
- @user = Factory.create(:user)
+ @tenant = FactoryGirl.create(:tenant)
+ @user = FactoryGirl.create(:user)
@tenant.users << @user
diff --git a/test/functional/phone_book_entries_controller_test.rb b/test/functional/phone_book_entries_controller_test.rb
index 81c5b61..b340f0f 100644
--- a/test/functional/phone_book_entries_controller_test.rb
+++ b/test/functional/phone_book_entries_controller_test.rb
@@ -3,9 +3,9 @@ require 'test_helper'
class PhoneBookEntriesControllerTest < ActionController::TestCase
setup do
- @user1 = Factory.create(:user)
+ @user1 = FactoryGirl.create(:user)
pb = @user1.phone_books.first
- @user1_phone_book_entry = Factory.create(
+ @user1_phone_book_entry = FactoryGirl.create(
:phone_book_entry,
:phone_book_id => pb.id
)
diff --git a/test/functional/phone_books_controller_test.rb b/test/functional/phone_books_controller_test.rb
index a00f597..aef2890 100644
--- a/test/functional/phone_books_controller_test.rb
+++ b/test/functional/phone_books_controller_test.rb
@@ -2,19 +2,19 @@ require 'test_helper'
class PhoneBooksControllerTest < ActionController::TestCase
setup do
- @tenant = Factory.create(:tenant)
+ @tenant = FactoryGirl.create(:tenant)
@admins = @tenant.user_groups.find_or_create_by_name('Admins')
@users = @tenant.user_groups.find_or_create_by_name('Users')
- @user = Factory.create(:user)
+ @user = FactoryGirl.create(:user)
@tenant.users << @user
@users.users << @user
- @personal_phone_book = Factory.create(:phone_book,
+ @personal_phone_book = FactoryGirl.create(:phone_book,
:phone_bookable_type => @user.class.to_s,
:phone_bookable_id => @user.id
)
- phone_book_entry = Factory.create(:phone_book_entry)
+ phone_book_entry = FactoryGirl.create(:phone_book_entry)
@personal_phone_book.phone_book_entries << phone_book_entry
@expected_status_if_not_authorized = :redirect
@@ -34,7 +34,7 @@ class PhoneBooksControllerTest < ActionController::TestCase
end
test "should create phone_book" do
- phone_book2 = Factory.build(:phone_book,
+ phone_book2 = FactoryGirl.build(:phone_book,
:phone_bookable_type => @user.class.to_s,
:phone_bookable_id => @user.id
)
diff --git a/test/functional/phone_models_controller_test.rb b/test/functional/phone_models_controller_test.rb
index 2d1a87a..199be45 100644
--- a/test/functional/phone_models_controller_test.rb
+++ b/test/functional/phone_models_controller_test.rb
@@ -4,21 +4,21 @@ class PhoneModelsControllerTest < ActionController::TestCase
setup do
# Create a tenant:
- @tenant = Factory.create(:tenant)
+ @tenant = FactoryGirl.create(:tenant)
# Create a User who is member of the Tenant but has no special rights:
- @user = Factory.create(:user)
+ @user = FactoryGirl.create(:user)
@tenant.tenant_memberships.create(:user_id => @user.id)
@user.update_attributes!(:current_tenant_id => @tenant.id)
# Create a User who is member of the Tenant and has super admin rights:
- @super_admin = Factory.create(:user)
+ @super_admin = FactoryGirl.create(:user)
@tenant.tenant_memberships.create(:user_id => @super_admin.id)
@super_admin.update_attributes!(:current_tenant_id => @tenant.id)
# Create a PhoneModel
#
- @phone_model = Factory.create(:phone_model)
+ @phone_model = FactoryGirl.create(:phone_model)
end
[ '@user.id', '' ].each do |user_id_code|
@@ -44,7 +44,7 @@ class PhoneModelsControllerTest < ActionController::TestCase
session[:user_id] = eval( user_id_code )
assert_no_difference('PhoneModel.count') do
- post :create, manufacturer_id: @phone_model.manufacturer_id, phone_model: Factory.build(:phone_model,
+ post :create, manufacturer_id: @phone_model.manufacturer_id, phone_model: FactoryGirl.build(:phone_model,
:manufacturer_id => @phone_model.manufacturer_id).attributes
end
end
@@ -106,7 +106,7 @@ class PhoneModelsControllerTest < ActionController::TestCase
# # add routes first.
# test "should create phone_model as super admin" do
# assert_difference('PhoneModel.count') do
- # post :create, phone_model: Factory.build(:phone_model,
+ # post :create, phone_model: FactoryGirl.build(:phone_model,
# :manufacturer_id => @phone_model.manufacturer_id).attributes
# end
#
diff --git a/test/functional/phone_number_ranges_controller_test.rb b/test/functional/phone_number_ranges_controller_test.rb
index 39f28c4..9569f3e 100644
--- a/test/functional/phone_number_ranges_controller_test.rb
+++ b/test/functional/phone_number_ranges_controller_test.rb
@@ -5,7 +5,7 @@ class PhoneNumberRangesControllerTest < ActionController::TestCase
#TODO Uncomment tests once the views are implemented.
setup do
- @phone_number_range = Factory.create(:phone_number_range)
+ @phone_number_range = FactoryGirl.create(:phone_number_range)
end
test "should get index" do
diff --git a/test/functional/phone_numbers_controller_test.rb b/test/functional/phone_numbers_controller_test.rb
index ab0a4b2..b11e3e8 100644
--- a/test/functional/phone_numbers_controller_test.rb
+++ b/test/functional/phone_numbers_controller_test.rb
@@ -3,8 +3,8 @@ require 'test_helper'
class PhoneNumbersControllerTest < ActionController::TestCase
setup do
- @tenant = Factory.create(:tenant)
- @user = Factory.create(:user)
+ @tenant = FactoryGirl.create(:tenant)
+ @user = FactoryGirl.create(:user)
@tenant.tenant_memberships.create(:user_id => @user.id)
@@ -12,11 +12,11 @@ class PhoneNumbersControllerTest < ActionController::TestCase
@private_phone_book = @user.phone_books.first
- @private_phone_book_entry = Factory.create(
+ @private_phone_book_entry = FactoryGirl.create(
:phone_book_entry,
:phone_book => @private_phone_book
)
- @phone_number = Factory.create(
+ @phone_number = FactoryGirl.create(
:phone_number,
:phone_numberable => @private_phone_book_entry
)
diff --git a/test/functional/phones_controller_test.rb b/test/functional/phones_controller_test.rb
index 1b0aa55..f2cc716 100644
--- a/test/functional/phones_controller_test.rb
+++ b/test/functional/phones_controller_test.rb
@@ -6,7 +6,7 @@ class PhonesControllerTest < ActionController::TestCase
#TODO Uncomment tests once the route has been implemented.
# setup do
-# @phone = Factory.create(:phone)
+# @phone = FactoryGirl.create(:phone)
# end
#
# test "should get index" do
@@ -24,7 +24,7 @@ class PhonesControllerTest < ActionController::TestCase
# #
# # test "should create phone" do
# # assert_difference('Phone.count') do
-# # post :create, phone: Factory.build(:phone, :phone_model_id => @phone.phone_model_id).attributes
+# # post :create, phone: FactoryGirl.build(:phone, :phone_model_id => @phone.phone_model_id).attributes
# # end
# #
# # assert_redirected_to phone_path(assigns(:phone))
diff --git a/test/functional/phones_sip_accounts_controller_test.rb b/test/functional/phones_sip_accounts_controller_test.rb
index 967b8fe..834e502 100644
--- a/test/functional/phones_sip_accounts_controller_test.rb
+++ b/test/functional/phones_sip_accounts_controller_test.rb
@@ -3,7 +3,7 @@ require 'test_helper'
class PhonesSipAccountsControllerTest < ActionController::TestCase
setup do
- @phones_sip_account = Factory.create(:phones_sip_account)
+ @phones_sip_account = FactoryGirl.create(:phones_sip_account)
end
# test "should get index" do
diff --git a/test/functional/route_elements_controller_test.rb b/test/functional/route_elements_controller_test.rb
new file mode 100644
index 0000000..3d7afaa
--- /dev/null
+++ b/test/functional/route_elements_controller_test.rb
@@ -0,0 +1,49 @@
+require 'test_helper'
+
+class RouteElementsControllerTest < ActionController::TestCase
+ setup do
+ @route_element = route_elements(:one)
+ end
+
+ test "should get index" do
+ get :index
+ assert_response :success
+ assert_not_nil assigns(:route_elements)
+ end
+
+ test "should get new" do
+ get :new
+ assert_response :success
+ end
+
+ test "should create route_element" do
+ assert_difference('RouteElement.count') do
+ post :create, route_element: @route_element.attributes
+ end
+
+ assert_redirected_to route_element_path(assigns(:route_element))
+ end
+
+ test "should show route_element" do
+ get :show, id: @route_element.to_param
+ assert_response :success
+ end
+
+ test "should get edit" do
+ get :edit, id: @route_element.to_param
+ assert_response :success
+ end
+
+ test "should update route_element" do
+ put :update, id: @route_element.to_param, route_element: @route_element.attributes
+ assert_redirected_to route_element_path(assigns(:route_element))
+ end
+
+ test "should destroy route_element" do
+ assert_difference('RouteElement.count', -1) do
+ delete :destroy, id: @route_element.to_param
+ end
+
+ assert_redirected_to route_elements_path
+ end
+end
diff --git a/test/functional/sip_accounts_controller_test.rb b/test/functional/sip_accounts_controller_test.rb
index 5c97dd2..e079718 100644
--- a/test/functional/sip_accounts_controller_test.rb
+++ b/test/functional/sip_accounts_controller_test.rb
@@ -3,10 +3,10 @@ require 'test_helper'
class SipAccountsControllerTest < ActionController::TestCase
setup do
- @tenant = Factory.create(:tenant)
- @user = Factory.create(:user)
+ @tenant = FactoryGirl.create(:tenant)
+ @user = FactoryGirl.create(:user)
@tenant.tenant_memberships.create(:user_id => @user.id)
- @sip_account = @user.sip_accounts.create( Factory.build(:sip_account).attributes )
+ @sip_account = @user.sip_accounts.create( FactoryGirl.build(:sip_account).attributes )
@parent_param = @sip_account.sip_accountable_type.foreign_key.to_sym
@parent_id = @sip_account.sip_accountable.id
@@ -32,7 +32,7 @@ class SipAccountsControllerTest < ActionController::TestCase
assert_difference('SipAccount.count') do
post :create,
@parent_param => @parent_id,
- sip_account: Factory.attributes_for(:sip_account)
+ sip_account: FactoryGirl.attributes_for(:sip_account)
end
end
diff --git a/test/functional/sip_domains_controller_test.rb b/test/functional/sip_domains_controller_test.rb
index f26ea02..5cbd519 100644
--- a/test/functional/sip_domains_controller_test.rb
+++ b/test/functional/sip_domains_controller_test.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class SipDomainsControllerTest < ActionController::TestCase
setup do
- @sip_domain = Factory.create(:sip_domain)
+ @sip_domain = FactoryGirl.create(:sip_domain)
end
test "should get index" do
@@ -18,7 +18,7 @@ class SipDomainsControllerTest < ActionController::TestCase
test "should create sip_domain" do
assert_difference('SipDomain.count') do
- post :create, sip_domain: Factory.build(:sip_domain).attributes
+ post :create, sip_domain: FactoryGirl.build(:sip_domain).attributes
end
assert_redirected_to sip_domain_path(assigns(:sip_domain))
diff --git a/test/functional/tenants_controller_test.rb b/test/functional/tenants_controller_test.rb
index b4e2df4..7c5ec93 100644
--- a/test/functional/tenants_controller_test.rb
+++ b/test/functional/tenants_controller_test.rb
@@ -4,7 +4,7 @@ class TenantsControllerTest < ActionController::TestCase
# TODO Create tests which test that a login user has specific rights.
# setup do
- # @tenant = Factory.create(:tenant)
+ # @tenant = FactoryGirl.create(:tenant)
# end
#
# test "should get index" do
@@ -20,7 +20,7 @@ class TenantsControllerTest < ActionController::TestCase
#
# test "should create tenant" do
# assert_difference('Tenant.count') do
- # post :create, tenant: Factory.build(:tenant).attributes
+ # post :create, tenant: FactoryGirl.build(:tenant).attributes
# end
#
# assert_redirected_to tenant_path(assigns(:tenant))
diff --git a/test/functional/trigger_controller_test.rb b/test/functional/trigger_controller_test.rb
new file mode 100644
index 0000000..de64e4f
--- /dev/null
+++ b/test/functional/trigger_controller_test.rb
@@ -0,0 +1,14 @@
+require 'test_helper'
+
+class TriggerControllerTest < ActionController::TestCase
+ test "should get voicemail" do
+ get :voicemail
+ assert_response :success
+ end
+
+ test "should get fax" do
+ get :fax
+ assert_response :success
+ end
+
+end
diff --git a/test/functional/user_groups_controller_test.rb b/test/functional/user_groups_controller_test.rb
index 0e39048..6f0c753 100644
--- a/test/functional/user_groups_controller_test.rb
+++ b/test/functional/user_groups_controller_test.rb
@@ -4,7 +4,7 @@ class UserGroupsControllerTest < ActionController::TestCase
# TODO Create tests which test that a login user has specific rights.
# setup do
- # @user_group = Factory.create(:user_group)
+ # @user_group = FactoryGirl.create(:user_group)
# end
#
# test "should get index" do
@@ -20,7 +20,7 @@ class UserGroupsControllerTest < ActionController::TestCase
#
# test "should create user_group" do
# assert_difference('UserGroup.count') do
- # post :create, user_group: Factory.build(:user_group).attributes
+ # post :create, user_group: FactoryGirl.build(:user_group).attributes
# end
#
# assert_redirected_to user_group_path(assigns(:user_group))
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index d1898f7..987b3df 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -2,8 +2,8 @@ require 'test_helper'
class UsersControllerTest < ActionController::TestCase
setup do
- @tenant = Factory.create(:tenant)
- @user = Factory.create(:user)
+ @tenant = FactoryGirl.create(:tenant)
+ @user = FactoryGirl.create(:user)
@tenant.tenant_memberships.create(:user_id => @user.id)
@@ -30,7 +30,7 @@ class UsersControllerTest < ActionController::TestCase
# test "should create user" do
# session[:user_id] = nil
# assert_difference('User.count') do
- # post :create, user: Factory.build(:user).attributes
+ # post :create, user: FactoryGirl.build(:user).attributes
# end
#
# # assert_redirected_to user_path(assigns(:user))