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.11 spec/requests/account_roles_spec.rb
iugusdk-1.0.10 spec/requests/account_roles_spec.rb
iugusdk-1.0.9 spec/requests/account_roles_spec.rb
iugusdk-1.0.8 spec/requests/account_roles_spec.rb
iugusdk-1.0.7 spec/requests/account_roles_spec.rb
iugusdk-1.0.6 spec/requests/account_roles_spec.rb
iugusdk-1.0.5 spec/requests/account_roles_spec.rb
iugusdk-1.0.4 spec/requests/account_roles_spec.rb
iugusdk-1.0.3 spec/requests/account_roles_spec.rb
iugusdk-1.0.2 spec/requests/account_roles_spec.rb
iugusdk-1.0.1 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.32 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.31 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.30 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.29 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.28 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.27 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.26 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.25 spec/requests/account_roles_spec.rb
iugusdk-1.0.0.alpha.24 spec/requests/account_roles_spec.rb