Sha256: 25410e2265a9ce4590035040f105f5485c7f036f4ccfa8c31304deafc9c791b9

Contents?: true

Size: 826 Bytes

Versions: 4

Compression:

Stored size: 826 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_id, :user_id => @current_account_user.user_id
      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_id
      post :update, :id => @account_id, :user_id => @user.id, :roles => []
    end
  
    it { response.should redirect_to account_users_index_path(@account_id)}
  
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iugusdk-1.0.0.alpha.5 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.4 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.3 spec/controllers/account_roles_controller_spec.rb
iugusdk-1.0.0.alpha.2 spec/controllers/account_roles_controller_spec.rb