mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:14:12 +08:00
Allow categories with null position, which means sort them based on activity. Mix absolutely positioned (position is not null) categories with null position categories.
This commit is contained in:
@ -105,6 +105,8 @@ describe CategoriesController do
|
||||
|
||||
|
||||
describe "logged in" do
|
||||
let(:valid_attrs) { {id: @category.id, name: "hello", color: "ff0", text_color: "fff"} }
|
||||
|
||||
before do
|
||||
@user = log_in(:moderator)
|
||||
@category = Fabricate(:category, user: @user)
|
||||
@ -146,7 +148,6 @@ describe CategoriesController do
|
||||
describe "success" do
|
||||
|
||||
it "updates the group correctly" do
|
||||
|
||||
readonly = CategoryGroup.permission_types[:readonly]
|
||||
create_post = CategoryGroup.permission_types[:create_post]
|
||||
|
||||
@ -167,7 +168,13 @@ describe CategoriesController do
|
||||
@category.color.should == "ff0"
|
||||
@category.hotness.should == 2
|
||||
@category.auto_close_hours.should == 72
|
||||
end
|
||||
|
||||
it "can set category to use default position" do
|
||||
xhr :put, :update, valid_attrs.merge(position: 'default')
|
||||
response.should be_success
|
||||
@category.reload
|
||||
@category.position.should be_nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user