Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix operator fixture and retailer/wholesaler test. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/controllers/retailers_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions test/controllers/wholesalers_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/operators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'