DEV: Fix incorrect test.

This commit is contained in:
Guo Xiang Tan 2019-03-11 11:00:47 +08:00
parent 9d0698e2a8
commit 8384075184

View File

@ -139,6 +139,7 @@ describe Post do
post = Fabricate(:post, post_args)
post.custom_fields["post_notice_type"] = "returning"
post.custom_fields["post_notice_time"] = 1.day.ago
post.save_custom_fields
post
}
@ -149,10 +150,8 @@ describe Post do
describe 'recovery' do
it 'deletes notices' do
post.recover!
expect(post.custom_fields).not_to have_key("post_notice_type")
expect(post.custom_fields).not_to have_key("post_notice_time")
expect { post.recover! }
.to change { post.custom_fields.length }.from(2).to(0)
end
end
end