Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing edge cases for optional variables #247

Open
jandudulski opened this issue Jan 20, 2023 · 0 comments · May be fixed by #273
Open

Failing edge cases for optional variables #247

jandudulski opened this issue Jan 20, 2023 · 0 comments · May be fixed by #273
Assignees

Comments

@jandudulski
Copy link

I would like to use such pattern: /(something/:optional/)and/:always but router doesn't catch it. Failing test:

    describe "optional variable with variable" do
      let(:router) do
        described_class.new do
          get "/(test1/:foo/)test2/:bar", as: :variable, to: RecognitionTestCase.endpoint("variable")
        end
      end

      it "recognizes route(s)" do
        runner.run!([
          [:variable, "/test1/foo/test2/bar", {foo: "foo", bar: "bar"}],
          [:variable, "/test2/bar", {foo: nil, bar: "bar"}]
        ])
      end
    end
 Failure/Error: expect(name).to be_nil

  expected: nil
       got: :variable

I'm not sure if it's bug or my bad usage?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants