diff options
author | Peter Kozak <spag@golwen.net> | 2013-01-13 16:39:33 +0000 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-01-13 16:39:33 +0000 |
commit | a5922502d5d1ec053375c07ba12af0475d30adbe (patch) | |
tree | dc3bb422e47962b0a0f30d3d68418d9984ed0726 /test | |
parent | 9847f54b4ee56c87c0b215df003493ae723d1edf (diff) |
gateway tests
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/gateways_controller_test.rb | 49 | ||||
-rw-r--r-- | test/unit/gateway_test.rb | 7 |
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 |