spec/spec_helper.rb
# todo: should rewrite this as an expectation
should rewrite this as an expectation
should rewrite this as an expectation
def ensure_redirect response, url_matcher
    expect(response.code).to eq('301').or eq('302')
    expect(response.header['location']).to match url_matcher
    response.header['location']
  end
def ensure_redirect response , url_matcher expect ( response . code ) . to eq ( '301' ) . or eq ( '302' ) expect ( response . header [ 'location' ] ) . to match url_matcher response . header [ 'location' ] end
todo: should rewrite this as an expectation
todo : should rewrite this as an expectation
# href = document(response.body).css('a').attr('href').value # expect(href).to match url_matcher
response
url_matcher