diff --git a/test/controllers/retailers_controller_test.rb b/test/controllers/retailers_controller_test.rb index 89e0310..3b75745 100644 --- a/test/controllers/retailers_controller_test.rb +++ b/test/controllers/retailers_controller_test.rb @@ -21,10 +21,12 @@ class RetailersControllerTest < ActionController::TestCase test "should create operator" do assert_difference('Retailer.count') do post :create, retailer: - { name: @operator.name, tax_category: @operator.tax_category } + { name: @operator.name, + tax_category: @operator.tax_category, + cuit: @operator.cuit } end - assert_redirected_to retailer_path(assigns(:operator)) + assert_redirected_to retailers_path end test "should show operator" do @@ -39,7 +41,7 @@ class RetailersControllerTest < ActionController::TestCase test "should update operator" do patch :update, id: @operator, retailer: { name: @operator.name } - assert_redirected_to retailer_path(assigns(:operator)) + assert_redirected_to retailers_path end test "should destroy operator" do diff --git a/test/controllers/wholesalers_controller_test.rb b/test/controllers/wholesalers_controller_test.rb index bfac46e..88bba5e 100644 --- a/test/controllers/wholesalers_controller_test.rb +++ b/test/controllers/wholesalers_controller_test.rb @@ -21,10 +21,12 @@ class WholesalersControllerTest < ActionController::TestCase test "should create operator" do assert_difference('Wholesaler.count') do post :create, wholesaler: - { name: @operator.name, tax_category: @operator.tax_category } + { name: @operator.name, + tax_category: @operator.tax_category, + cuit: @operator.cuit } end - assert_redirected_to wholesaler_path(assigns(:operator)) + assert_redirected_to wholesalers_path end test "should show operator" do @@ -39,7 +41,7 @@ class WholesalersControllerTest < ActionController::TestCase test "should update operator" do patch :update, id: @operator, wholesaler: { name: @operator.name } - assert_redirected_to wholesaler_path(assigns(:operator)) + assert_redirected_to wholesalers_path end test "should destroy operator" do diff --git a/test/fixtures/operators.yml b/test/fixtures/operators.yml index f4cdad6..b040327 100644 --- a/test/fixtures/operators.yml +++ b/test/fixtures/operators.yml @@ -2,10 +2,10 @@ retailer: name: 'Marcelo Guimenez' type: Retailer tax_category: 'MONOTRIBUTO' - cuit: 216547897 + cuit: '21-65478998-7' wholesaler: name: 'Bucanero' type: Wholesaler tax_category: 'MONOTRIBUTO' - cuit: 216547898 + cuit: '21-65478998-8'