Sha256: d83a613401efda895a25b5659017f521360cd22b6a4cfe56679592bfbde868e3

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require 'spec_helper'

describe "Settings requests" do
  context "settings layout" do
    before(:each) do
      visit '/account/auth/facebook'
    end

    context "when allow_create_accounts == false" do
      before(:each) do
        IuguSDK::allow_create_account = false
      end

      context "when user has only 1 account" do
        before(:each) do
          @user = User.last
          @user.accounts.destroy_all
          @user.accounts << Fabricate(:account)
          visit settings_path
        end

        it { page.should have_link I18n.t("iugu.account") }

      end

      context "when user has more than 1 account" do
        before(:each) do
          @user = User.last
          @user.accounts.destroy_all
          2.times { @user.accounts << Fabricate(:account) }
          visit settings_path
        end

        it { page.should have_link I18n.t("iugu.accounts") }

      end
    end


    context "when allow_create_accounts == true" do
      before(:each) do
        IuguSDK::allow_create_account = true
        visit settings_path
      end

      it { page.should have_link I18n.t("iugu.accounts") }

    end
  
    
  
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.1 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.0 spec/requests/settings_spec.rb