Sha256: 707a03fd7fcfa2c7ae2f0e5cdb17a29b8292680c0918ba7650080ee440567e27

Contents?: true

Size: 1.4 KB

Versions: 76

Compression:

Stored size: 1.4 KB

Contents

def fill_in_facebook_login_form(options = {})
  facebook_user = options[:with]

  sleep 1

  within sf('the Facebook login form') do
    fill_in               'Email',    :with => facebook_user['email']
    fill_in               'Password', :with => facebook_user['password']
    click_link_or_button  'Log In'
  end
end

def log_in_to_facebook(user)
  ###
  # We use this URL due to how selenium throws an error if you
  # interact with items that are off the visible area of the
  # page
  #
  visit 'https://www.facebook.com/login.php'

  sleep 3

  fill_in               'Email',     :with => user['email']
  fill_in               'Password',  :with => user['password']

  click_link_or_button  'Log In'
end

def log_out_of_facebook
  click_link   idsf('the Facebook account menu')
  click_button 'Log Out'
end

def authenticate_with_facebook
  visit '/users/auth/facebook'
end

def click_facebook_tab(tab_name)
  find(:xpath, %Q{.//span[starts-with(., '#{tab_name}')]/../..}).click()
end

def remove_app_from_authorized_apps_at_facebook(app_name)
  visit 'http://www.facebook.com/settings?tab=applications'

  page.should_not have_content 'You have not authorized any apps to interact with your Facebook account.'
  page.should     have_content app_name

  find("input[type='button'][title='Remove']").click()

  sleep 1

  click_link_or_button 'Remove'

  sleep 1

  page.should_not have_content app_name

  log_out_of_facebook
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
rspectacular-0.59.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.58.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.57.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.56.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.55.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.54.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.53.1 lib/rspectacular/helpers/facebook.rb
rspectacular-0.53.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.52.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.51.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.50.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.49.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.48.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.47.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.46.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.45.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.44.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.43.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.42.0 lib/rspectacular/helpers/facebook.rb
rspectacular-0.41.0 lib/rspectacular/helpers/facebook.rb