Skip to content

Commit

Permalink
Add spec to test when a published post is unpublished
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilyeo committed Jun 27, 2024
1 parent bdee3ae commit 438d1e3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/models/post_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@
post.save
end
end

describe 'a published post when' do
it 'has been changed to unpublished' do
post = FactoryBot.create(:post)
post.published_at = nil

expect(post).not_to receive(:notify_slack)
post.save
end
end
end

describe '#increment_likes' do
Expand Down

0 comments on commit 438d1e3

Please sign in to comment.