Sha256: 20e60d6c8938cb0a5b00fb6e915a539101ddf46b008923ab10489a5e5b7cc0fb

Contents?: true

Size: 814 Bytes

Versions: 35

Compression:

Stored size: 814 Bytes

Contents

require 'spec_helper'

describe Iugu::AccountRolesController do

  context "edit" do
    login_as_user

    context "when current_user owns the account" do

      before(:each) do
        @current_account_user = @user.account_users.first
        @current_account_user.set_roles(["owner"])
        get :edit, :id => @current_account_user.account, :user_id => @current_account_user.user
      end

      it { response.should render_template "iugu/account_roles/edit" }
      it { response.should be_success }

    end

  end

  context "update" do
    login_as_user
    before(:each) do
      @account_id = @user.account_users.first.account
      post :update, :id => @account_id, :user_id => @user, :roles => []
    end
  
    it { response.should redirect_to account_users_index_path(@account_id)}
  
  end
  
end

Version data entries

35 entries across 35 versions & 1 rubygems

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