DEV: Prefer save! over save.

This commit is contained in:
Guo Xiang Tan 2019-06-04 16:40:10 +08:00
parent 33bc8c276d
commit 6ad58913c8

View File

@ -451,7 +451,7 @@ describe Email::Receiver do
category.email_in = "category@bar.com"
category.email_in_allow_strangers = true
category.set_permissions(Group[:trust_level_4] => :full)
category.save
category.save!
expect { process(:staged_reply_restricted) }.to change { topic.posts.count }
end
@ -860,7 +860,7 @@ describe Email::Receiver do
group.save
category.set_permissions(group => :create_post)
category.save
category.save!
# raises an InvalidAccess when the user doesn't have the privileges to create a topic
expect { process(:existing_user) }.to raise_error(Discourse::InvalidAccess)
@ -933,7 +933,7 @@ describe Email::Receiver do
Fabricate(:user, email: "tl4@bar.com", trust_level: TrustLevel[4])
category.set_permissions(Group[:trust_level_4] => :full)
category.save
category.save!
Group.refresh_automatic_group!(:trust_level_4)
@ -1264,7 +1264,7 @@ describe Email::Receiver do
context "read-only category" do
before do
category.set_permissions(everyone: :readonly)
category.save
category.save!
Fabricate(:user, email: "alice@foo.com")
Fabricate(:user, email: "bob@bar.com")