Merge #2654 "Fix access to the version history of organization-level roles"
This commit is contained in:
commit
e4251d7b67
8 changed files with 83 additions and 41 deletions
|
|
@ -59,6 +59,17 @@ FactoryBot.define do
|
|||
biography { '<div id="divInjectedElement"></div>' }
|
||||
end
|
||||
|
||||
factory :organization_admin, parent: :user do
|
||||
transient do
|
||||
organization { create(:organization) }
|
||||
end
|
||||
|
||||
after(:create) do |user, evaluator|
|
||||
user.roles << Role.find_or_create_by(name: 'organization_admin', resource: evaluator.organization)
|
||||
user.save!
|
||||
end
|
||||
end
|
||||
|
||||
factory :organizer, parent: :user do
|
||||
transient do
|
||||
resource { create(:resource) }
|
||||
|
|
|
|||
|
|
@ -318,17 +318,14 @@ feature 'Version' do
|
|||
end
|
||||
|
||||
context 'organization role', feature: true, versioning: true, js: true do
|
||||
let!(:organization_admin) { create(:organization_admin, organization: conference.organization) }
|
||||
let!(:user) { create(:user) }
|
||||
let!(:role) do
|
||||
Role.find_by(
|
||||
resource_id: conference.organization.id,
|
||||
resource_type: 'Organization'
|
||||
)
|
||||
end
|
||||
|
||||
setup do
|
||||
user.add_role :organization_admin, conference.organization
|
||||
user.remove_role :organization_admin, conference.organization
|
||||
|
||||
sign_in organization_admin
|
||||
visit admin_revision_history_path
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue