You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pages_spec.rb
    path of file: ./repos/refinerycms/pages/spec/system/refinery/admin
    
    the code of the file until where you have to start completion: # encoding: utf-8
require "spec_helper"

def expect_window_with_content(
    
def switch_page_form_locale(locale)
  within "#switch_locale_picker" do
    find("a", text: locale.upcase).click
  end

  # make sure that the locale change has taken effect
  expect(page).to have_selector("#switch_locale_picker li.selected a##{locale.downcase}")
end