removed redundant ribica name from subfolders
This commit is contained in:
0
back-office/test/controllers/.keep
Normal file
0
back-office/test/controllers/.keep
Normal file
49
back-office/test/controllers/categories_controller_test.rb
Normal file
49
back-office/test/controllers/categories_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CategoriesControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@category = categories(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:categories)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create category" do
|
||||
assert_difference('Category.count') do
|
||||
post :create, category: { name: @category.name }
|
||||
end
|
||||
|
||||
assert_redirected_to category_path(assigns(:category))
|
||||
end
|
||||
|
||||
test "should show category" do
|
||||
get :show, id: @category
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @category
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update category" do
|
||||
patch :update, id: @category, category: { name: @category.name }
|
||||
assert_redirected_to category_path(assigns(:category))
|
||||
end
|
||||
|
||||
test "should destroy category" do
|
||||
assert_difference('Category.count', -1) do
|
||||
delete :destroy, id: @category
|
||||
end
|
||||
|
||||
assert_redirected_to categories_path
|
||||
end
|
||||
end
|
||||
49
back-office/test/controllers/items_controller_test.rb
Normal file
49
back-office/test/controllers/items_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ItemsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@item = items(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:items)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create item" do
|
||||
assert_difference('Item.count') do
|
||||
post :create, item: { code: @item.code, current_input_price: @item.current_input_price, description: @item.description, list_price: @item.list_price, name: @item.name, on_display: @item.on_display, stock: @item.stock, sub_category_id: @item.sub_category_id, unit_id: @item.unit_id, units_in_pack: @item.units_in_pack }
|
||||
end
|
||||
|
||||
assert_redirected_to item_path(assigns(:item))
|
||||
end
|
||||
|
||||
test "should show item" do
|
||||
get :show, id: @item
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @item
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update item" do
|
||||
patch :update, id: @item, item: { code: @item.code, current_input_price: @item.current_input_price, description: @item.description, list_price: @item.list_price, name: @item.name, on_display: @item.on_display, stock: @item.stock, sub_category_id: @item.sub_category_id, unit_id: @item.unit_id, units_in_pack: @item.units_in_pack }
|
||||
assert_redirected_to item_path(assigns(:item))
|
||||
end
|
||||
|
||||
test "should destroy item" do
|
||||
assert_difference('Item.count', -1) do
|
||||
delete :destroy, id: @item
|
||||
end
|
||||
|
||||
assert_redirected_to items_path
|
||||
end
|
||||
end
|
||||
49
back-office/test/controllers/media_types_controller_test.rb
Normal file
49
back-office/test/controllers/media_types_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class MediaTypesControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@media_type = media_types(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:media_types)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create media_type" do
|
||||
assert_difference('MediaType.count') do
|
||||
post :create, media_type: { name: @media_type.name }
|
||||
end
|
||||
|
||||
assert_redirected_to media_type_path(assigns(:media_type))
|
||||
end
|
||||
|
||||
test "should show media_type" do
|
||||
get :show, id: @media_type
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @media_type
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update media_type" do
|
||||
patch :update, id: @media_type, media_type: { name: @media_type.name }
|
||||
assert_redirected_to media_type_path(assigns(:media_type))
|
||||
end
|
||||
|
||||
test "should destroy media_type" do
|
||||
assert_difference('MediaType.count', -1) do
|
||||
delete :destroy, id: @media_type
|
||||
end
|
||||
|
||||
assert_redirected_to media_types_path
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class MultiMediaDescriptionsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@multi_media_description = multi_media_descriptions(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:multi_media_descriptions)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create multi_media_description" do
|
||||
assert_difference('MultiMediaDescription.count') do
|
||||
post :create, multi_media_description: { item_id: @multi_media_description.item_id, media_type_id: @multi_media_description.media_type_id, url: @multi_media_description.url }
|
||||
end
|
||||
|
||||
assert_redirected_to multi_media_description_path(assigns(:multi_media_description))
|
||||
end
|
||||
|
||||
test "should show multi_media_description" do
|
||||
get :show, id: @multi_media_description
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @multi_media_description
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update multi_media_description" do
|
||||
patch :update, id: @multi_media_description, multi_media_description: { item_id: @multi_media_description.item_id, media_type_id: @multi_media_description.media_type_id, url: @multi_media_description.url }
|
||||
assert_redirected_to multi_media_description_path(assigns(:multi_media_description))
|
||||
end
|
||||
|
||||
test "should destroy multi_media_description" do
|
||||
assert_difference('MultiMediaDescription.count', -1) do
|
||||
delete :destroy, id: @multi_media_description
|
||||
end
|
||||
|
||||
assert_redirected_to multi_media_descriptions_path
|
||||
end
|
||||
end
|
||||
49
back-office/test/controllers/sections_controller_test.rb
Normal file
49
back-office/test/controllers/sections_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SectionsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@section = sections(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:sections)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create section" do
|
||||
assert_difference('Section.count') do
|
||||
post :create, section: { name: @section.name }
|
||||
end
|
||||
|
||||
assert_redirected_to section_path(assigns(:section))
|
||||
end
|
||||
|
||||
test "should show section" do
|
||||
get :show, id: @section
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @section
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update section" do
|
||||
patch :update, id: @section, section: { name: @section.name }
|
||||
assert_redirected_to section_path(assigns(:section))
|
||||
end
|
||||
|
||||
test "should destroy section" do
|
||||
assert_difference('Section.count', -1) do
|
||||
delete :destroy, id: @section
|
||||
end
|
||||
|
||||
assert_redirected_to sections_path
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SubCategoriesControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@sub_category = sub_categories(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:sub_categories)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create sub_category" do
|
||||
assert_difference('SubCategory.count') do
|
||||
post :create, sub_category: { category_id: @sub_category.category_id, name: @sub_category.name }
|
||||
end
|
||||
|
||||
assert_redirected_to sub_category_path(assigns(:sub_category))
|
||||
end
|
||||
|
||||
test "should show sub_category" do
|
||||
get :show, id: @sub_category
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @sub_category
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update sub_category" do
|
||||
patch :update, id: @sub_category, sub_category: { category_id: @sub_category.category_id, name: @sub_category.name }
|
||||
assert_redirected_to sub_category_path(assigns(:sub_category))
|
||||
end
|
||||
|
||||
test "should destroy sub_category" do
|
||||
assert_difference('SubCategory.count', -1) do
|
||||
delete :destroy, id: @sub_category
|
||||
end
|
||||
|
||||
assert_redirected_to sub_categories_path
|
||||
end
|
||||
end
|
||||
49
back-office/test/controllers/units_controller_test.rb
Normal file
49
back-office/test/controllers/units_controller_test.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UnitsControllerTest < ActionController::TestCase
|
||||
setup do
|
||||
@unit = units(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
get :index
|
||||
assert_response :success
|
||||
assert_not_nil assigns(:units)
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get :new
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create unit" do
|
||||
assert_difference('Unit.count') do
|
||||
post :create, unit: { name: @unit.name, short_name: @unit.short_name }
|
||||
end
|
||||
|
||||
assert_redirected_to unit_path(assigns(:unit))
|
||||
end
|
||||
|
||||
test "should show unit" do
|
||||
get :show, id: @unit
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
get :edit, id: @unit
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update unit" do
|
||||
patch :update, id: @unit, unit: { name: @unit.name, short_name: @unit.short_name }
|
||||
assert_redirected_to unit_path(assigns(:unit))
|
||||
end
|
||||
|
||||
test "should destroy unit" do
|
||||
assert_difference('Unit.count', -1) do
|
||||
delete :destroy, id: @unit
|
||||
end
|
||||
|
||||
assert_redirected_to units_path
|
||||
end
|
||||
end
|
||||
0
back-office/test/fixtures/.keep
vendored
Normal file
0
back-office/test/fixtures/.keep
vendored
Normal file
7
back-office/test/fixtures/categories.yml
vendored
Normal file
7
back-office/test/fixtures/categories.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
25
back-office/test/fixtures/items.yml
vendored
Normal file
25
back-office/test/fixtures/items.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
code: MyString
|
||||
current_input_price: 9.99
|
||||
list_price: 9.99
|
||||
unit_id: 1
|
||||
units_in_pack: 9.99
|
||||
description: MyText
|
||||
sub_category_id: 1
|
||||
stock: 1
|
||||
on_display: false
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
code: MyString
|
||||
current_input_price: 9.99
|
||||
list_price: 9.99
|
||||
unit_id: 1
|
||||
units_in_pack: 9.99
|
||||
description: MyText
|
||||
sub_category_id: 1
|
||||
stock: 1
|
||||
on_display: false
|
||||
7
back-office/test/fixtures/media_types.yml
vendored
Normal file
7
back-office/test/fixtures/media_types.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
11
back-office/test/fixtures/multi_media_descriptions.yml
vendored
Normal file
11
back-office/test/fixtures/multi_media_descriptions.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
url: MyString
|
||||
item_id: 1
|
||||
media_type_id: 1
|
||||
|
||||
two:
|
||||
url: MyString
|
||||
item_id: 1
|
||||
media_type_id: 1
|
||||
7
back-office/test/fixtures/sections.yml
vendored
Normal file
7
back-office/test/fixtures/sections.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
9
back-office/test/fixtures/sub_categories.yml
vendored
Normal file
9
back-office/test/fixtures/sub_categories.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
category_id: 1
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
category_id: 1
|
||||
9
back-office/test/fixtures/units.yml
vendored
Normal file
9
back-office/test/fixtures/units.yml
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name: MyString
|
||||
short_name: MyString
|
||||
|
||||
two:
|
||||
name: MyString
|
||||
short_name: MyString
|
||||
0
back-office/test/helpers/.keep
Normal file
0
back-office/test/helpers/.keep
Normal file
0
back-office/test/integration/.keep
Normal file
0
back-office/test/integration/.keep
Normal file
0
back-office/test/mailers/.keep
Normal file
0
back-office/test/mailers/.keep
Normal file
0
back-office/test/models/.keep
Normal file
0
back-office/test/models/.keep
Normal file
7
back-office/test/models/category_test.rb
Normal file
7
back-office/test/models/category_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CategoryTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
back-office/test/models/item_test.rb
Normal file
7
back-office/test/models/item_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class ItemTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
back-office/test/models/media_type_test.rb
Normal file
7
back-office/test/models/media_type_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class MediaTypeTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
back-office/test/models/multi_media_description_test.rb
Normal file
7
back-office/test/models/multi_media_description_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class MultiMediaDescriptionTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
back-office/test/models/section_test.rb
Normal file
7
back-office/test/models/section_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SectionTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
back-office/test/models/sub_category_test.rb
Normal file
7
back-office/test/models/sub_category_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class SubCategoryTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
7
back-office/test/models/unit_test.rb
Normal file
7
back-office/test/models/unit_test.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
require 'test_helper'
|
||||
|
||||
class UnitTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
10
back-office/test/test_helper.rb
Normal file
10
back-office/test/test_helper.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
ENV['RAILS_ENV'] ||= 'test'
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/test_help'
|
||||
|
||||
class ActiveSupport::TestCase
|
||||
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
||||
fixtures :all
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
end
|
||||
Reference in New Issue
Block a user