mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Nested Categories (#1561)
* Prepare entry search for nested categories * Subcategory implementation * Remove caching for test stability
This commit is contained in:
@@ -28,7 +28,7 @@ class CategoriesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
new_category = Category.order(:created_at).last
|
||||
|
||||
assert_redirected_to transactions_url
|
||||
assert_redirected_to categories_url
|
||||
assert_equal "New Category", new_category.name
|
||||
assert_equal color, new_category.color
|
||||
end
|
||||
@@ -46,7 +46,7 @@ class CategoriesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
new_category = Category.order(:created_at).last
|
||||
|
||||
assert_redirected_to transactions_url
|
||||
assert_redirected_to categories_url
|
||||
assert_equal "New Category", new_category.name
|
||||
assert_equal color, new_category.color
|
||||
assert_equal @transaction.reload.category, new_category
|
||||
@@ -69,6 +69,14 @@ class CategoriesControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
end
|
||||
|
||||
assert_redirected_to transactions_url
|
||||
assert_redirected_to categories_url
|
||||
end
|
||||
|
||||
test "bootstrap" do
|
||||
assert_difference "Category.count", 16 do
|
||||
post bootstrap_categories_url
|
||||
end
|
||||
|
||||
assert_redirected_to categories_url
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,15 +15,6 @@ class RegistrationsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_redirected_to root_url
|
||||
end
|
||||
|
||||
test "create seeds default transaction categories" do
|
||||
assert_difference "Category.count", Category::DEFAULT_CATEGORIES.size do
|
||||
post registration_url, params: { user: {
|
||||
email: "john@example.com",
|
||||
password: "password",
|
||||
password_confirmation: "password" } }
|
||||
end
|
||||
end
|
||||
|
||||
test "create when hosted requires an invite code" do
|
||||
with_env_overrides REQUIRE_INVITE_CODE: "true" do
|
||||
assert_no_difference "User.count" do
|
||||
|
||||
Reference in New Issue
Block a user