Skip to content

Move spinach public snippet feature to rspec spec

What does this MR do?

Removes the spinach feature for public snippets and adds the equivalent rspec feature.

Are there points in the code the reviewer needs to double check?

The original spinach feature steps, for the show page scenario, was asserting the absence of a css class on the page.:

 expect(page).to have_no_xpath("//i[@class='public-snippet']")

But this class is no longer in use:

$ grep -nHR public-snippet app
# zero results

Meaning that this assertion was a false positive. So in the new rspec feature I've asserted that the content of the snippet is visible for both scenarios. I was a little concerned that the factory generated content might not render the same in the HTML view for the snippet, but the simple sentence that is generated seems to be fine to match against.

Why was this MR needed?

To start whittling down the long list of spinach tests to migrate to rspec: #23036 (moved)

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

#23036 (moved)

Merge request reports