discourse-calendar/spec/integration/topic_spec.rb

30 lines
720 B
Ruby
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# frozen_string_literal: true
require "rails_helper"
describe Topic do
before do
freeze_time
Jobs.run_immediately!
SiteSetting.calendar_enabled = true
SiteSetting.discourse_post_event_enabled = true
end
let(:user) { Fabricate(:user, refresh_auto_groups: true) }
context "when a topic is created" do
context "with a date in title" do
it "doesnt create a post event" do
post_with_date =
PostCreator.create!(
user,
title: "Lets buy a boat with me tomorrow",
raw: "The boat market is quite active lately.",
)
expect(DiscoursePostEvent::Event).to_not exist(id: post_with_date.id)
end
end
end
end