2019-04-30 10:27:42 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 05:27:38 +03:00
|
|
|
RSpec.describe PostValidator do
|
2019-05-07 03:12:20 +00:00
|
|
|
fab!(:topic) { Fabricate(:topic) }
|
2019-03-14 10:39:51 +08:00
|
|
|
let(:post) { build(:post, topic: topic) }
|
2019-10-02 14:01:53 +10:00
|
|
|
let(:validator) { PostValidator.new({}) }
|
2013-06-13 18:18:17 +10:00
|
|
|
|
2022-07-27 12:21:10 +02:00
|
|
|
describe "#post_body_validator" do
|
2017-04-27 11:53:53 +08:00
|
|
|
it "should not allow a post with an empty raw" do
|
2016-12-05 13:31:43 +01:00
|
|
|
post.raw = ""
|
|
|
|
validator.post_body_validator(post)
|
2017-04-27 11:53:53 +08:00
|
|
|
expect(post.errors).to_not be_empty
|
|
|
|
end
|
|
|
|
|
|
|
|
context "when empty raw can bypass validation" do
|
2019-10-02 14:01:53 +10:00
|
|
|
let(:validator) { PostValidator.new(skip_post_body: true) }
|
2017-04-27 11:53:53 +08:00
|
|
|
|
|
|
|
it "should be allowed for empty raw based on site setting" do
|
|
|
|
post.raw = ""
|
|
|
|
validator.post_body_validator(post)
|
|
|
|
expect(post.errors).to be_empty
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
context "when post's topic is a PM between a human and a non human user" do
|
2022-10-25 09:29:09 +02:00
|
|
|
fab!(:robot) { Fabricate(:bot) }
|
2019-05-07 03:12:20 +00:00
|
|
|
fab!(:user) { Fabricate(:user) }
|
2017-04-27 11:53:53 +08:00
|
|
|
|
|
|
|
let(:topic) do
|
|
|
|
Fabricate(
|
|
|
|
:private_message_topic,
|
|
|
|
topic_allowed_users: [
|
|
|
|
Fabricate.build(:topic_allowed_user, user: robot),
|
|
|
|
Fabricate.build(:topic_allowed_user, user: user),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should allow a post with an empty raw" do
|
|
|
|
post = Fabricate.build(:post, topic: topic)
|
|
|
|
post.raw = ""
|
|
|
|
validator.post_body_validator(post)
|
|
|
|
|
|
|
|
expect(post.errors).to be_empty
|
|
|
|
end
|
2016-12-05 13:31:43 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "stripped_length" do
|
2013-06-13 18:18:17 +10:00
|
|
|
it "adds an error for short raw" do
|
|
|
|
post.raw = "abc"
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
end
|
|
|
|
|
2021-03-24 16:47:35 +02:00
|
|
|
it "counts emoji as a single character" do
|
|
|
|
post.raw = ":smiling_face_with_three_hearts:" * (SiteSetting.min_post_length - 1)
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
|
|
|
|
post = build(:post, topic: topic)
|
|
|
|
post.raw = ":smiling_face_with_three_hearts:" * SiteSetting.min_post_length
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "counts multiple characters as a single character" do
|
|
|
|
post.raw = "." * SiteSetting.min_post_length
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
|
|
|
|
post = build(:post, topic: topic)
|
|
|
|
post.raw = "," * SiteSetting.min_post_length
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
|
|
|
|
post = build(:post, topic: topic)
|
|
|
|
post.raw = "<!-- #{"very long comment" * SiteSetting.min_post_length} -->"
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
end
|
|
|
|
|
2013-06-13 18:18:17 +10:00
|
|
|
it "adds no error for long raw" do
|
|
|
|
post.raw = "this is a long topic body testing 123"
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(0)
|
|
|
|
end
|
2021-01-07 15:44:17 -03:00
|
|
|
|
|
|
|
it "ignores an html comment" do
|
|
|
|
post.raw = "<!-- an html comment -->abc"
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "ignores multiple html comments" do
|
|
|
|
post.raw = "<!-- an html comment -->\n abc \n<!-- a comment -->"
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "ignores nested html comments" do
|
|
|
|
post.raw = "<!-- <!-- an html comment --> -->"
|
|
|
|
validator.stripped_length(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
|
|
|
end
|
2013-06-13 18:18:17 +10:00
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "too_many_posts" do
|
2013-12-19 13:45:55 -05:00
|
|
|
it "should be invalid when the user has posted too much" do
|
|
|
|
post.user.expects(:posted_too_much_in_topic?).returns(true)
|
|
|
|
validator.max_posts_validator(post)
|
|
|
|
expect(post.errors.count).to be > 0
|
|
|
|
end
|
|
|
|
|
2013-12-20 11:29:44 -05:00
|
|
|
it "should be allowed to edit when the user has posted too much" do
|
|
|
|
post.user.stubs(:posted_too_much_in_topic?).returns(true)
|
|
|
|
post.expects(:new_record?).returns(false)
|
|
|
|
validator.max_posts_validator(post)
|
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
|
2013-12-19 13:45:55 -05:00
|
|
|
it "should be valid when the user hasn't posted too much" do
|
|
|
|
post.user.expects(:posted_too_much_in_topic?).returns(false)
|
|
|
|
validator.max_posts_validator(post)
|
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "too_many_mentions" do
|
2016-02-01 21:07:49 +05:30
|
|
|
before do
|
|
|
|
SiteSetting.newuser_max_mentions_per_post = 2
|
|
|
|
SiteSetting.max_mentions_per_post = 3
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be invalid when new user exceeds max mentions limit" do
|
|
|
|
post.acting_user = build(:newuser)
|
|
|
|
post.expects(:raw_mentions).returns(%w[jake finn jake_old])
|
|
|
|
validator.max_mention_validator(post)
|
|
|
|
expect(post.errors.count).to be > 0
|
|
|
|
end
|
|
|
|
|
2017-02-26 17:40:42 -07:00
|
|
|
it "should be invalid when leader user exceeds max mentions limit" do
|
2016-02-01 21:07:49 +05:30
|
|
|
post.acting_user = build(:trust_level_4)
|
|
|
|
post.expects(:raw_mentions).returns(%w[jake finn jake_old jake_new])
|
|
|
|
validator.max_mention_validator(post)
|
|
|
|
expect(post.errors.count).to be > 0
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be valid when new user does not exceed max mentions limit" do
|
|
|
|
post.acting_user = build(:newuser)
|
|
|
|
post.expects(:raw_mentions).returns(%w[jake finn])
|
|
|
|
validator.max_mention_validator(post)
|
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
|
2016-04-18 22:08:42 +02:00
|
|
|
it "should be valid when new user exceeds max mentions limit in PM" do
|
|
|
|
post.acting_user = build(:newuser)
|
|
|
|
post.topic.expects(:private_message?).returns(true)
|
|
|
|
post.expects(:raw_mentions).returns(%w[jake finn jake_old])
|
|
|
|
validator.max_mention_validator(post)
|
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
|
2017-02-26 17:40:42 -07:00
|
|
|
it "should be valid when leader user does not exceed max mentions limit" do
|
2016-02-01 21:07:49 +05:30
|
|
|
post.acting_user = build(:trust_level_4)
|
|
|
|
post.expects(:raw_mentions).returns(%w[jake finn jake_old])
|
|
|
|
validator.max_mention_validator(post)
|
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be valid for moderator in all cases" do
|
|
|
|
post.acting_user = build(:moderator)
|
|
|
|
post.expects(:raw_mentions).never
|
|
|
|
validator.max_mention_validator(post)
|
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be valid for admin in all cases" do
|
|
|
|
post.acting_user = build(:admin)
|
|
|
|
post.expects(:raw_mentions).never
|
|
|
|
validator.max_mention_validator(post)
|
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "too_many_embedded_media" do
|
2018-04-05 09:51:03 +05:30
|
|
|
before do
|
2020-08-07 12:08:59 -04:00
|
|
|
SiteSetting.min_trust_to_post_embedded_media = 0
|
|
|
|
SiteSetting.newuser_max_embedded_media = 2
|
2018-04-05 09:51:03 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "should be invalid when new user exceeds max mentions limit" do
|
|
|
|
post.acting_user = build(:newuser)
|
2020-08-07 12:08:59 -04:00
|
|
|
post.expects(:embedded_media_count).returns(3)
|
|
|
|
validator.max_embedded_media_validator(post)
|
2018-04-05 09:51:03 +05:30
|
|
|
expect(post.errors.count).to be > 0
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be valid when new user does not exceed max mentions limit" do
|
|
|
|
post.acting_user = build(:newuser)
|
2020-08-07 12:08:59 -04:00
|
|
|
post.expects(:embedded_media_count).returns(2)
|
|
|
|
validator.max_embedded_media_validator(post)
|
2018-04-05 09:51:03 +05:30
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be invalid when user trust level is not sufficient" do
|
2020-08-07 12:08:59 -04:00
|
|
|
SiteSetting.min_trust_to_post_embedded_media = 4
|
2018-04-05 09:51:03 +05:30
|
|
|
post.acting_user = build(:leader)
|
2020-08-07 12:08:59 -04:00
|
|
|
post.expects(:embedded_media_count).returns(2)
|
|
|
|
validator.max_embedded_media_validator(post)
|
2018-04-05 09:51:03 +05:30
|
|
|
expect(post.errors.count).to be > 0
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be valid for moderator in all cases" do
|
|
|
|
post.acting_user = build(:moderator)
|
2020-08-07 12:08:59 -04:00
|
|
|
post.expects(:embedded_media_count).never
|
|
|
|
validator.max_embedded_media_validator(post)
|
2018-04-05 09:51:03 +05:30
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should be valid for admin in all cases" do
|
|
|
|
post.acting_user = build(:admin)
|
2020-08-07 12:08:59 -04:00
|
|
|
post.expects(:embedded_media_count).never
|
|
|
|
validator.max_embedded_media_validator(post)
|
2018-04-05 09:51:03 +05:30
|
|
|
expect(post.errors.count).to be(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "invalid post" do
|
2013-06-13 18:18:17 +10:00
|
|
|
it "should be invalid" do
|
|
|
|
validator.validate(post)
|
|
|
|
expect(post.errors.count).to be > 0
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-09-06 11:50:05 -04:00
|
|
|
describe "unique_post_validator" do
|
2022-03-29 15:23:55 +08:00
|
|
|
fab!(:user) { Fabricate(:user) }
|
2022-06-29 15:35:07 +10:00
|
|
|
fab!(:post) { Fabricate(:post, raw: "Non PM topic body", user: user, topic: topic) }
|
|
|
|
fab!(:pm_post) do
|
|
|
|
Fabricate(:post, raw: "PM topic body", user: user, topic: Fabricate(:private_message_topic))
|
2023-01-09 11:18:21 +00:00
|
|
|
end
|
2019-03-14 10:39:51 +08:00
|
|
|
|
2013-09-06 11:50:05 -04:00
|
|
|
before do
|
2017-07-07 15:09:14 +09:00
|
|
|
SiteSetting.unique_posts_mins = 5
|
2022-06-29 15:35:07 +10:00
|
|
|
|
2019-03-14 10:39:51 +08:00
|
|
|
post.store_unique_post_key
|
2022-06-29 15:35:07 +10:00
|
|
|
pm_post.store_unique_post_key
|
|
|
|
|
2019-03-14 10:39:51 +08:00
|
|
|
@key = post.unique_post_key
|
2022-06-29 15:35:07 +10:00
|
|
|
@pm_key = pm_post.unique_post_key
|
2019-03-14 10:39:51 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
2019-12-03 10:05:53 +01:00
|
|
|
Discourse.redis.del(@key)
|
2022-06-29 15:35:07 +10:00
|
|
|
Discourse.redis.del(@pm_key)
|
2013-09-06 11:50:05 -04:00
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
context "when post is unique" do
|
2019-03-14 10:39:51 +08:00
|
|
|
let(:new_post) { Fabricate.build(:post, user: user, raw: "unique content", topic: topic) }
|
2013-09-06 11:50:05 -04:00
|
|
|
|
|
|
|
it "should not add an error" do
|
2019-03-14 10:39:51 +08:00
|
|
|
validator.unique_post_validator(new_post)
|
|
|
|
expect(new_post.errors.count).to eq(0)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should not add an error when changing an existing post" do
|
|
|
|
post.raw = "changing raw"
|
|
|
|
|
2013-09-06 11:50:05 -04:00
|
|
|
validator.unique_post_validator(post)
|
2015-01-09 13:34:37 -03:00
|
|
|
expect(post.errors.count).to eq(0)
|
2013-09-06 11:50:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
context "when post is not unique" do
|
2022-06-29 15:35:07 +10:00
|
|
|
def build_post(is_pm:, raw:)
|
|
|
|
Fabricate.build(
|
|
|
|
:post,
|
|
|
|
user: user,
|
|
|
|
raw: raw,
|
|
|
|
topic: is_pm ? Fabricate.build(:private_message_topic) : topic,
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should add an error for post dupes" do
|
|
|
|
new_post = build_post(is_pm: false, raw: post.raw)
|
|
|
|
|
|
|
|
validator.unique_post_validator(new_post)
|
|
|
|
expect(new_post.errors.to_hash.keys).to contain_exactly(:raw)
|
2013-09-06 11:50:05 -04:00
|
|
|
end
|
|
|
|
|
2022-06-29 15:35:07 +10:00
|
|
|
it "should add an error for pm dupes" do
|
|
|
|
new_post = build_post(is_pm: true, raw: pm_post.raw)
|
|
|
|
|
2019-03-14 10:39:51 +08:00
|
|
|
validator.unique_post_validator(new_post)
|
2019-04-30 16:58:18 +10:00
|
|
|
expect(new_post.errors.to_hash.keys).to contain_exactly(:raw)
|
2013-09-06 11:50:05 -04:00
|
|
|
end
|
|
|
|
|
2022-06-29 15:35:07 +10:00
|
|
|
it "should not add an error for cross PM / topic dupes" do
|
|
|
|
new_post = build_post(is_pm: true, raw: post.raw)
|
|
|
|
|
|
|
|
validator.unique_post_validator(new_post)
|
|
|
|
expect(new_post.errors.count).to eq(0)
|
|
|
|
|
|
|
|
new_post = build_post(is_pm: false, raw: pm_post.raw)
|
|
|
|
|
|
|
|
validator.unique_post_validator(new_post)
|
|
|
|
expect(new_post.errors.count).to eq(0)
|
|
|
|
end
|
|
|
|
|
2013-09-06 11:50:05 -04:00
|
|
|
it "should not add an error if post.skip_unique_check is true" do
|
2022-06-29 15:35:07 +10:00
|
|
|
new_post = build_post(is_pm: false, raw: post.raw)
|
|
|
|
|
2019-03-14 10:39:51 +08:00
|
|
|
new_post.skip_unique_check = true
|
|
|
|
validator.unique_post_validator(new_post)
|
|
|
|
expect(new_post.errors.count).to eq(0)
|
2013-09-06 11:50:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "force_edit_last_validator" do
|
2019-05-07 03:12:20 +00:00
|
|
|
fab!(:user) { Fabricate(:user) }
|
|
|
|
fab!(:other_user) { Fabricate(:user) }
|
|
|
|
fab!(:topic) { Fabricate(:topic) }
|
2018-11-14 16:48:16 +02:00
|
|
|
|
|
|
|
before { SiteSetting.max_consecutive_replies = 2 }
|
|
|
|
|
2018-12-03 18:03:11 +02:00
|
|
|
it "should always allow original poster to post" do
|
2018-12-03 12:32:29 +02:00
|
|
|
[user, user, user, other_user, user, user, user].each_with_index do |u, i|
|
2018-12-03 18:03:11 +02:00
|
|
|
post = Post.new(user: u, topic: topic, raw: "post number #{i}")
|
2018-12-03 12:32:29 +02:00
|
|
|
validator.force_edit_last_validator(post)
|
|
|
|
expect(post.errors.count).to eq(0)
|
2018-12-03 18:03:11 +02:00
|
|
|
post.save!
|
2018-12-03 12:32:29 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-05-10 22:18:17 +03:00
|
|
|
it "should allow category moderators to post more than 2 consecutive replies" do
|
|
|
|
SiteSetting.enable_category_group_moderation = true
|
|
|
|
group = Fabricate(:group)
|
|
|
|
GroupUser.create(group: group, user: user)
|
|
|
|
category = Fabricate(:category, reviewable_by_group_id: group.id)
|
|
|
|
topic.update!(category: category)
|
|
|
|
|
|
|
|
Post.create!(user: other_user, topic: topic, raw: "post number 1", post_number: 1)
|
|
|
|
Post.create!(user: user, topic: topic, raw: "post number 2", post_number: 2)
|
|
|
|
Post.create!(user: user, topic: topic, raw: "post number 3", post_number: 3)
|
|
|
|
|
|
|
|
post = Post.new(user: user, topic: topic, raw: "post number 4", post_number: 4)
|
|
|
|
validator.force_edit_last_validator(post)
|
|
|
|
expect(post.errors.count).to eq(0)
|
|
|
|
end
|
|
|
|
|
2018-11-14 16:48:16 +02:00
|
|
|
it "should not allow posting more than 2 consecutive replies" do
|
2019-01-18 13:18:20 +11:00
|
|
|
Post.create!(user: user, topic: topic, raw: "post number 2", post_number: 2)
|
|
|
|
Post.create!(user: user, topic: topic, raw: "post number 3", post_number: 3)
|
|
|
|
Post.create!(user: other_user, topic: topic, raw: "post number 1", post_number: 1)
|
2018-12-03 12:32:29 +02:00
|
|
|
|
2019-01-18 13:18:20 +11:00
|
|
|
post = Post.new(user: user, topic: topic, raw: "post number 4", post_number: 4)
|
2018-12-03 18:03:11 +02:00
|
|
|
validator.force_edit_last_validator(post)
|
|
|
|
expect(post.errors.count).to eq(1)
|
2018-11-14 16:48:16 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
it "should always allow editing" do
|
|
|
|
post = Fabricate(:post, user: user, topic: topic)
|
|
|
|
post = Fabricate(:post, user: user, topic: topic)
|
|
|
|
|
|
|
|
revisor = PostRevisor.new(post)
|
|
|
|
revisor.revise!(post.user, raw: "hello world123456789")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should allow posting more than 2 replies" do
|
|
|
|
3.times do
|
|
|
|
post = Fabricate(:post, user: user, topic: topic)
|
|
|
|
Fabricate(:post, user: other_user, topic: topic)
|
|
|
|
validator.force_edit_last_validator(post)
|
|
|
|
expect(post.errors.count).to eq(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-12-01 10:40:23 +01:00
|
|
|
shared_examples "almost no validations" do
|
2014-07-28 16:40:06 -04:00
|
|
|
it "skips most validations" do
|
2015-12-01 10:40:23 +01:00
|
|
|
validator.expects(:stripped_length).never
|
|
|
|
validator.expects(:raw_quality).never
|
|
|
|
validator.expects(:max_posts_validator).never
|
|
|
|
validator.expects(:max_mention_validator).never
|
2020-08-07 12:08:59 -04:00
|
|
|
validator.expects(:max_embedded_media_validator).never
|
2015-12-01 10:40:23 +01:00
|
|
|
validator.expects(:max_attachments_validator).never
|
2018-02-06 18:07:24 -05:00
|
|
|
validator.expects(:newuser_links_validator).never
|
2015-12-01 10:40:23 +01:00
|
|
|
validator.expects(:unique_post_validator).never
|
2018-11-14 16:48:16 +02:00
|
|
|
validator.expects(:force_edit_last_validator).never
|
2015-12-01 10:40:23 +01:00
|
|
|
validator.validate(post)
|
2014-07-28 16:40:06 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "admin editing a static page" do
|
2015-12-01 10:40:23 +01:00
|
|
|
before do
|
|
|
|
post.acting_user = build(:admin)
|
2017-07-07 15:09:14 +09:00
|
|
|
SiteSetting.tos_topic_id = post.topic_id
|
2015-12-01 10:40:23 +01:00
|
|
|
end
|
2015-11-30 19:08:35 +01:00
|
|
|
|
2015-12-01 10:40:23 +01:00
|
|
|
include_examples "almost no validations"
|
|
|
|
end
|
2015-11-30 19:08:35 +01:00
|
|
|
|
2022-07-27 18:14:14 +02:00
|
|
|
describe "staged user" do
|
2015-12-01 10:40:23 +01:00
|
|
|
before { post.acting_user = build(:user, staged: true) }
|
|
|
|
include_examples "almost no validations"
|
2015-11-30 19:08:35 +01:00
|
|
|
end
|
2013-06-13 18:18:17 +10:00
|
|
|
end
|