Skip to content

Commit

Permalink
Specs to ensure that user are listed only with allowed role
Browse files Browse the repository at this point in the history
  • Loading branch information
lpichler committed Apr 26, 2017
1 parent 9a0d0de commit 0481589
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/lib/rbac/filterer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,17 @@ def get_rbac_results_for_and_expect_objects(klass, expected_objects)
expect(MiqUserRole.count).to eq(3)
get_rbac_results_for_and_expect_objects(MiqGroup, [group])
end

let(:super_admin_group) do
FactoryGirl.create(:miq_group, :tenant => default_tenant, :miq_user_role => super_administrator_user_role)
end

let!(:super_admin_user) { FactoryGirl.create(:user, :miq_groups => [super_admin_group]) }

it 'can see all users expect to user with group with role EvmRole-super_administrator' do
expect(User.count).to eq(2)
get_rbac_results_for_and_expect_objects(User, [user])
end
end
end

Expand Down

0 comments on commit 0481589

Please sign in to comment.