Skip to content

Commit

Permalink
Extend and restructure LegacyPageUrl spec
Browse files Browse the repository at this point in the history
  • Loading branch information
robinboening committed Dec 12, 2020
1 parent 7da48b4 commit 377d598
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions spec/models/alchemy/legacy_page_url_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,22 @@
describe Alchemy::LegacyPageUrl do
let(:page) { build_stubbed(:alchemy_page) }

let(:page_url_with_parameters) do
Alchemy::LegacyPageUrl.new(urlname: "index.php?id=2", page: page)
end

let(:valid_page_url) do
Alchemy::LegacyPageUrl.new(urlname: "my/0-work+is-nice_stuff", page: page)
it "is invalid with invalid URL characters" do
expect(
Alchemy::LegacyPageUrl.new(urlname: "<foo>{bar}", page: page)
).to be_invalid
end

it "is only valid with correct urlname format" do
expect(valid_page_url).to be_valid
it "is valid with correct urlname format" do
expect(
Alchemy::LegacyPageUrl.new(urlname: "my/0-work+is-nice_stuff", page: page)
).to be_valid
end

it "is also valid with get parameters in urlname" do
expect(page_url_with_parameters).to be_valid
it "is valid with get parameters in urlname" do
expect(
Alchemy::LegacyPageUrl.new(urlname: "index.php?id=2", page: page)
).to be_valid
end

it "is valid with pound sign in urlname" do
Expand Down

0 comments on commit 377d598

Please sign in to comment.