Search code examples
site-prismaddressable-gem

How to correctly use the Site-prism URL expansion


I have a page object with the following setup:

class StudynoteShowPage < SitePrism::Page
  set_url "/studynotes{/studynote}"
end

When I use that page

ssp = StudynoteShowPage.new
ssp.load(studynote: @s1)

I get

ArgumentError:
  wrong number of arguments (given 1, expected 0)

Any ideas about that? I've already tried single and double quotes in the set_url, but that makes no difference. I can see that the addressable gem is included in my Gemfile.lock.


Solution

  • This "should" work. Could you please check the following.

    You have a version of site_prism > 2.12 (Or better > 3.0), You have addressable 2.5+

    You're using Ruby 2.2+ (Better 2.5/2.6)

    If you are and can re-create a SSCCE raise a Github issue (Ideally with all the code in a small clonable repo here: https://github.com/natritmeyer/site_prism/issues

    We have a variety of unit tests and a couple of feature tests that validate this code works (We may have missed something though)