Project

General

Profile

Actions

Bug #12143

closed

Plugin permissions not available during tests

Added by Stephen Benjamin about 9 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Plugin integration
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The security block is evaluated at rails start up, but the permissions aren't available in a test.

1. Install foreman_salt

2. Throw a binding.pry in app/services/foreman/plugin.rb

204:   Permission.where(:name => name).first_or_create(:resource_type => options[:resource_type])
=> 205: binding.pry if name.to_s == 'view_salt_environments'

3. In a test, binding.pry there too

4. Run the test. You can confirm the Permission exists when the plugin is loaded, but in the actual test, it's no longer there

Something with transactions or fixtures?


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #16821: AccessPermissionsTest does not pick up plugin permissionsClosedDominic Cleal10/06/2016Actions
Actions

Also available in: Atom PDF