Skip to content

Commit

Permalink
UT
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljames-dj committed Feb 3, 2025
1 parent 6b6b52e commit 4a59a94
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spec/models/competition_tab_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,18 @@
expect(competition.tabs.to_a).to eq [tab1, tab2, tab3]
end
end

context "#verify_if_full_urls" do
let(:competition_tab) { FactoryBot.build(:competition_tab) }

it "doesn't allow relative URLs" do
competition_tab.update(content: "[Link](/relative)")
expect(competition_tab).to be_invalid
end

it "allows full URLs" do
competition_tab.update(content: "[Link](http://full)")
expect(competition_tab).to be_valid
end
end
end

0 comments on commit 4a59a94

Please sign in to comment.