summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/functional/gateways_controller_test.rb49
-rw-r--r--test/unit/gateway_test.rb7
2 files changed, 56 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
diff --git a/test/unit/gateway_test.rb b/test/unit/gateway_test.rb
new file mode 100644
index 0000000..4c40dc9
--- /dev/null
+++ b/test/unit/gateway_test.rb
@@ -0,0 +1,7 @@
+require 'test_helper'
+
+class GatewayTest < ActiveSupport::TestCase
+ def test_should_be_valid
+ assert Gateway.new.valid?
+ end
+end