Skip to content

Commit

Permalink
FIX: BBCode parsing specs (#575)
Browse files Browse the repository at this point in the history
Requires discourse/discourse#27173 to be merged.

Will add a `.discourse-compatibility` once merged.
  • Loading branch information
ZogStriP committed Jun 18, 2024
1 parent 5ef5131 commit 20a9fe4
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions spec/integration/post_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,36 +202,18 @@
it "works with name attribute" do
post = create_post_with_event(user, 'name="foo bar"').reload
expect(post.event.name).to eq("foo bar")

post = create_post_with_event(user, 'name=""').reload
expect(post.event.name).to be_blank

post = create_post_with_event(user, "name=").reload
expect(post.event.name).to be_blank
end

it "works with url attribute" do
url = "https://www.discourse.org"

post = create_post_with_event(user, "url=\"#{url}\"").reload
expect(post.event.url).to eq(url)

post = create_post_with_event(user, 'url=""').reload
expect(post.event.url).to be_blank

post = create_post_with_event(user, "url=").reload
expect(post.event.url).to be_blank
end

it "works with status attribute" do
post = create_post_with_event(user, 'status="private"').reload
expect(post.event.status).to eq(DiscoursePostEvent::Event.statuses[:private])

post = create_post_with_event(user, 'status=""').reload
expect(post.event.status).to eq(DiscoursePostEvent::Event.statuses[:standalone])

post = create_post_with_event(user, "status=").reload
expect(post.event.status).to eq(DiscoursePostEvent::Event.statuses[:standalone])
end

it "works with allowedGroups attribute" do
Expand All @@ -254,10 +236,10 @@
create_post_with_event(user, 'status="private" allowedGroups="euro,america"').reload
expect(post.event.raw_invitees).to match_array(%w[euro america])

post = create_post_with_event(user, 'status="private" allowedGroups=""').reload
post = create_post_with_event(user, 'status="private"').reload
expect(post.event.raw_invitees).to eq([])

post = create_post_with_event(user, 'status="private" allowedGroups=').reload
post = create_post_with_event(user, 'status="private"').reload
expect(post.event.raw_invitees).to eq([])
end

Expand Down

0 comments on commit 20a9fe4

Please sign in to comment.