Adding routes for a new admin account page for users to manage their billing preferences and access invoices

This commit is contained in:
Rob Harrington
2015-07-03 15:36:27 +08:00
parent 70de4fd1fd
commit 92eb5ed367
3 changed files with 12 additions and 0 deletions

View File

@@ -90,6 +90,8 @@ class AbilityDecorator
end
can [:admin, :known_users], :search
can [:admin, :show], :account
end
def add_product_management_abilities(user)

View File

@@ -110,6 +110,8 @@ Openfoodnetwork::Application.routes.draw do
get :start_job
end
end
resource :account, only: [:show], controller: 'account'
end
namespace :api do

View File

@@ -477,6 +477,10 @@ module Spree
user
end
it 'should have the ability to view the admin account page' do
should have_ability([:admin, :show], for: :account)
end
it 'should have the ability to read and edit enterprises that I manage' do
should have_ability([:read, :edit, :update, :bulk_update], for: s1)
end
@@ -505,6 +509,10 @@ module Spree
it 'should have the ability to welcome and register enterprises that I own' do
should have_ability([:welcome, :register], for: s1)
end
it 'should have the ability to view the admin account page' do
should have_ability([:admin, :show], for: :account)
end
end
end
end