optional custom value for category slug (create and update)

This commit is contained in:
Jason W. May
2014-12-03 16:23:59 -08:00
parent 52f7f8e471
commit efa872e426
4 changed files with 45 additions and 12 deletions

View File

@ -43,13 +43,12 @@ describe CategoriesController do
end
end
describe "success" do
it "works" do
readonly = CategoryGroup.permission_types[:readonly]
create_post = CategoryGroup.permission_types[:create_post]
xhr :post, :create, name: "hello", color: "ff0", text_color: "fff",
xhr :post, :create, name: "hello", color: "ff0", text_color: "fff", slug: "hello-cat",
auto_close_hours: 72,
permissions: {
"everyone" => readonly,
@ -62,6 +61,7 @@ describe CategoriesController do
[Group[:everyone].id, readonly],[Group[:staff].id,create_post]
]
category.name.should == "hello"
category.slug.should == "hello-cat"
category.color.should == "ff0"
category.auto_close_hours.should == 72
end
@ -180,7 +180,7 @@ describe CategoriesController do
readonly = CategoryGroup.permission_types[:readonly]
create_post = CategoryGroup.permission_types[:create_post]
xhr :put, :update, id: @category.id, name: "hello", color: "ff0", text_color: "fff",
xhr :put, :update, id: @category.id, name: "hello", color: "ff0", text_color: "fff", slug: "hello-category",
auto_close_hours: 72,
permissions: {
"everyone" => readonly,
@ -193,6 +193,7 @@ describe CategoriesController do
[Group[:everyone].id, readonly],[Group[:staff].id,create_post]
]
@category.name.should == "hello"
@category.slug.should == "hello-category"
@category.color.should == "ff0"
@category.auto_close_hours.should == 72
end