I was wondering if there's a way to achieve what I want with RSpec. So I want to test an array of hashes that looks similar to this one:
array_example =
[
{
id: 1,
link: "www.some-link.com/path_im_not_interested_in"
},
{
id: 2,
link: "www.example-link.com/another_useless_path"
}
]
I want to do integration test in which I won't include those paths in links. I'm only interested in checking if www.some-link.com and www.example-link.com are present in those hashes in array. Something like this:
expect(array_example).to match_array(
[
{
id: 1,
link: "www.some-link.com"
},
{
id: 2,
link: "www.example-link.com"
}
]
But this one obviously won't work. Is there a way to achieve what I want? I would like to avoid using custom matchers.