Sha256: adcdab2ffea385835c14b8896f4706cd85c477a5db0bdf6c9d9e43431cbf0e04

Contents?: true

Size: 1.47 KB

Versions: 1

Compression:

Stored size: 1.47 KB

Contents

require 'spec_helper'

describe 'account settings view' do
  before(:each) do
    IuguSDK::enable_social_login = true
    IuguSDK::enable_social_linking = true
    visit '/account/auth/facebook'
    visit profile_settings_path
  end 

  it { page.should have_link I18n.t("iugu.remove_user") }
  it { page.should have_content I18n.t("iugu.social_account") }

  context "when user is being destroyed" do
    before(:each) do
      click_on I18n.t("iugu.remove_user")
    end

    it { page.should have_content I18n.t("iugu.user_destruction_in") }
    it { page.should have_link I18n.t("iugu.undo") }
  
  end

  context "when user destruction job is locked" do
    before(:each) do
      User.last.destroy
      @job = User.last.destruction_job
      @job.locked_at = Time.now
      @job.save
      visit profile_settings_path
    end

    it { page.should_not have_link I18n.t("iugu.undo") }
  
  end

  context "when enable_social_linking == false" do
    before(:each) do
      IuguSDK::enable_social_linking = false
      visit profile_settings_path
    end

    it { page.should_not have_content I18n.t("iugu.social_account") }
  
  end

  context "when user is a guest" do
    before(:each) do
      IuguSDK::enable_guest_user = true
      visit root_path
      click_link I18n.t("iugu.sign_out")
      visit new_user_registration_path
      click_link I18n.t("iugu.try_first")
      visit profile_settings_path
    end

    it { page.should have_button I18n.t("iugu.become_user") } 
  
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.3 spec/requests/user_spec.rb