summaryrefslogtreecommitdiff
path: root/test/functional/gateways_controller_test.rb
diff options
context:
space:
mode:
authorPeter Kozak <spag@golwen.net>2013-01-13 16:39:33 +0000
committerPeter Kozak <spag@golwen.net>2013-01-13 16:39:33 +0000
commita5922502d5d1ec053375c07ba12af0475d30adbe (patch)
treedc3bb422e47962b0a0f30d3d68418d9984ed0726 /test/functional/gateways_controller_test.rb
parent9847f54b4ee56c87c0b215df003493ae723d1edf (diff)
gateway tests
Diffstat (limited to 'test/functional/gateways_controller_test.rb')
-rw-r--r--test/functional/gateways_controller_test.rb49
1 files changed, 49 insertions, 0 deletions
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