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.0.alpha.23 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.22 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.21 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.20 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.19 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.18 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.17 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.16 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.14 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.13 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.12 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.11 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.10 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.9 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.7 spec/controllers/account_roles_controller_spec.rb