forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: should not raise error when minimum_required_tags value not defi…
…ned for category. (discourse#27658) While creating a new category if the user didn't specify a value for `minimum_required_tags` input but clicked it then it returned the "PG::NotNullViolation: null value in column 'minimum_required_tags'" error.
- Loading branch information
1 parent
0b3b101
commit e8a4101
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
describe "New Category", type: :system do | ||
fab!(:admin) | ||
let(:category_page) { PageObjects::Pages::Category.new } | ||
|
||
before { sign_in(admin) } | ||
|
||
it "should create category with 0 in minimum_required_tags column when not defined" do | ||
category_page.visit_new_category | ||
|
||
category_page.find(".edit-category-tab-general input.category-name").fill_in( | ||
with: "New Category", | ||
) | ||
category_page.find(".edit-category-nav .edit-category-tags a").click | ||
category_page.find(".edit-category-tab-tags #category-minimum-tags").click | ||
category_page.save_settings | ||
|
||
expect(page).to have_current_path("/c/new-category/edit/general") | ||
|
||
category_page.find(".edit-category-nav .edit-category-tags a").click | ||
expect(category_page.find(".edit-category-tab-tags #category-minimum-tags").value).to eq("0") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters