Sha256: b842b5d05b3a47183b25309b4089f2b19fc063b78dae0bc9ed6f02cba8685393

Contents?: true

Size: 1.25 KB

Versions: 39

Compression:

Stored size: 1.25 KB

Contents

require 'spec_helper'

describe 'Account Roles requests' do
  context "edit view" do
    before(:each) do
      IuguSDK::enable_social_login = true
      visit '/account/auth/facebook'
      @user = User.last
      @account = @user.accounts.first
      @account_user =  @account.account_users.find_by_user_id(@user.id)
    end

    context "when current_user is account owner" do
      before(:each) do
        @account_user.set_roles [ "owner" ]
        visit account_roles_edit_path(:id => @account.id, :user_id => @user.id)
      end

      APP_ROLES['roles'].each do |role|
        it { page.should have_content role }
      end
    
    end
    
    context "when current_user is account admin" do
      before(:each) do
        @account.account_users << Fabricate(:account_user) { user Fabricate(:user) { email "notowner@account.test" } }
        @account_user.set_roles [ "admin" ]
        visit account_roles_edit_path(:id => @account.id, :user_id => @user.id)
      end
    
      APP_ROLES['roles'].each do |role|
        if role == APP_ROLES['owner_role'] || role == APP_ROLES['admin_role']
          it { page.should_not have_content role }
        else
          it { page.should have_content role }
        end
      end
      
    
    end
  
    
  
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.23 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.22 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.21 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.20 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.19 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.18 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.17 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.16 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.14 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.13 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.12 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.11 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.10 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.9 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.7 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.5 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.4 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.3 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.2 spec/requests/account_roles_spec.rb