mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 06:55:43 +08:00
Prefer save!/create!
over save/create
.
This commit is contained in:
parent
65be3c627d
commit
ee82abba3c
@ -30,17 +30,23 @@ describe TrustLevel3Requirements do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "returns if the user has ever been suspended" do
|
it "returns if the user has ever been suspended" do
|
||||||
user.save
|
user.save!
|
||||||
|
|
||||||
expect(tl3_requirements.penalty_counts.suspended).to eq(0)
|
expect(tl3_requirements.penalty_counts.suspended).to eq(0)
|
||||||
expect(tl3_requirements.penalty_counts.total).to eq(0)
|
expect(tl3_requirements.penalty_counts.total).to eq(0)
|
||||||
|
|
||||||
UserHistory.create(target_user_id: user.id, action: UserHistory.actions[:suspend_user])
|
UserHistory.create!(
|
||||||
|
target_user_id: user.id,
|
||||||
|
action: UserHistory.actions[:suspend_user]
|
||||||
|
)
|
||||||
|
|
||||||
expect(tl3_requirements.penalty_counts.suspended).to eq(1)
|
expect(tl3_requirements.penalty_counts.suspended).to eq(1)
|
||||||
expect(tl3_requirements.penalty_counts.total).to eq(1)
|
expect(tl3_requirements.penalty_counts.total).to eq(1)
|
||||||
|
|
||||||
UserHistory.create(target_user_id: user.id, action: UserHistory.actions[:unsuspend_user])
|
UserHistory.create!(
|
||||||
|
target_user_id: user.id,
|
||||||
|
action: UserHistory.actions[:unsuspend_user]
|
||||||
|
)
|
||||||
|
|
||||||
expect(tl3_requirements.penalty_counts.suspended).to eq(0)
|
expect(tl3_requirements.penalty_counts.suspended).to eq(0)
|
||||||
expect(tl3_requirements.penalty_counts.total).to eq(0)
|
expect(tl3_requirements.penalty_counts.total).to eq(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user