REFACTOR: Just pass a block instead of using a lambda.
This commit is contained in:
parent
77a4968272
commit
37e5ee858f
|
@ -83,12 +83,18 @@ describe TopicCreator do
|
||||||
context 'failure cases' do
|
context 'failure cases' do
|
||||||
it "min_trust_to_send_messages setting should be checked when sending private message" do
|
it "min_trust_to_send_messages setting should be checked when sending private message" do
|
||||||
SiteSetting.min_trust_to_send_messages = TrustLevel[4]
|
SiteSetting.min_trust_to_send_messages = TrustLevel[4]
|
||||||
expect(-> { TopicCreator.create(user, Guardian.new(user), pm_valid_attrs) }).to raise_error(ActiveRecord::Rollback)
|
|
||||||
|
expect do
|
||||||
|
TopicCreator.create(user, Guardian.new(user), pm_valid_attrs)
|
||||||
|
end.to raise_error(ActiveRecord::Rollback)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "min_trust_to_send_email_messages should be checked when sending private messages via email" do
|
it "min_trust_to_send_email_messages should be checked when sending private messages via email" do
|
||||||
SiteSetting.min_trust_to_send_email_messages = TrustLevel[4]
|
SiteSetting.min_trust_to_send_email_messages = TrustLevel[4]
|
||||||
expect(-> { TopicCreator.create(user, Guardian.new(user), pm_to_email_valid_attrs) }).to raise_error(ActiveRecord::Rollback)
|
|
||||||
|
expect do
|
||||||
|
TopicCreator.create(user, Guardian.new(user), pm_to_email_valid_attrs)
|
||||||
|
end.to raise_error(ActiveRecord::Rollback)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue