Test access to organization_admin version as organization_admin
This corrects the specification for the behavior of the Revision History screen; changes to the organization administrator role should be accessible to organization administrators, not conference organizers.
This commit is contained in:
parent
de24d4a34c
commit
4dd15d6120
2 changed files with 14 additions and 0 deletions
|
|
@ -69,6 +69,17 @@ FactoryBot.define do
|
||||||
biography { '<div id="divInjectedElement"></div>' }
|
biography { '<div id="divInjectedElement"></div>' }
|
||||||
end
|
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
|
factory :organizer, parent: :user do
|
||||||
transient do
|
transient do
|
||||||
resource { create(:resource) }
|
resource { create(:resource) }
|
||||||
|
|
|
||||||
|
|
@ -319,11 +319,14 @@ feature 'Version' do
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'organization role', feature: true, versioning: true, js: true do
|
context 'organization role', feature: true, versioning: true, js: true do
|
||||||
|
let!(:organization_admin) { create(:organization_admin, organization: conference.organization) }
|
||||||
let!(:user) { create(:user) }
|
let!(:user) { create(:user) }
|
||||||
|
|
||||||
setup do
|
setup do
|
||||||
user.add_role :organization_admin, conference.organization
|
user.add_role :organization_admin, conference.organization
|
||||||
user.remove_role :organization_admin, conference.organization
|
user.remove_role :organization_admin, conference.organization
|
||||||
|
|
||||||
|
sign_in organization_admin
|
||||||
visit admin_revision_history_path
|
visit admin_revision_history_path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue