Skip to content

Instantly share code, notes, and snippets.

@gdpelican
Created December 6, 2014 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdpelican/d7d9a0f49eadd8a12c60 to your computer and use it in GitHub Desktop.
Save gdpelican/d7d9a0f49eadd8a12c60 to your computer and use it in GitHub Desktop.
Test which fails when Uncategorized category is not yet created [Discourse]
context "when the category is being set to 'Uncategorized'" do
it "changes the category and returns the topic_id" do
topic.update category: category
tba = TopicsBulkAction.new(topic.user, [topic.id], type: 'change_category', category_id: 0)
topic_ids = tba.perform!
topic_ids.should == [topic.id]
topic.reload
topic.category.name.should == 'Uncategorized'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment