Sha256: c30b106b7c1e4e2c47fe08fb3b2b8c2ea0bd01127395c4918cb6ef2dee718ca3

Contents?: true

Size: 1.15 KB

Versions: 39

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

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

    context "when enable_multiple_accounts == false" do
      before(:each) do
        IuguSDK::enable_multiple_accounts = 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 enable_multiple_accounts == true" do
      before(:each) do
        IuguSDK::enable_multiple_accounts = true
        visit settings_path
      end

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

    end
  
    
  
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
iugusdk-1.0.11 spec/requests/settings_spec.rb
iugusdk-1.0.10 spec/requests/settings_spec.rb
iugusdk-1.0.9 spec/requests/settings_spec.rb
iugusdk-1.0.8 spec/requests/settings_spec.rb
iugusdk-1.0.7 spec/requests/settings_spec.rb
iugusdk-1.0.6 spec/requests/settings_spec.rb
iugusdk-1.0.5 spec/requests/settings_spec.rb
iugusdk-1.0.4 spec/requests/settings_spec.rb
iugusdk-1.0.3 spec/requests/settings_spec.rb
iugusdk-1.0.2 spec/requests/settings_spec.rb
iugusdk-1.0.1 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.32 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.31 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.30 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.29 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.28 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.27 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.26 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.25 spec/requests/settings_spec.rb
iugusdk-1.0.0.alpha.24 spec/requests/settings_spec.rb