Refactor the static pages spec

Created a variable using the *let* method of rspec