* added ability to assign moderator role via admin/super admin * create Mod User in seeds * add Cypress specs * fix failing Cypress tests * fix failing specs by moving test Mod user to the end * nudge Travis * nudge Travis Co-authored-by: Arit Amana <msarit@gmail.com>
18 lines
730 B
Ruby
18 lines
730 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe Role, type: :model do
|
|
it { is_expected.to belong_to(:resource).optional }
|
|
it { is_expected.to validate_inclusion_of(:resource_type).in_array(Rolify.resource_types) }
|
|
it { is_expected.to validate_inclusion_of(:name).in_array(described_class::ROLES) }
|
|
|
|
describe "::ROLES" do
|
|
it "contains the correct values" do
|
|
expected_roles = %w[
|
|
admin codeland_admin comment_suspended mod_relations_admin podcast_admin
|
|
restricted_liquid_tag single_resource_admin super_admin support_admin suspended tag_moderator tech_admin
|
|
trusted warned workshop_pass creator moderator
|
|
]
|
|
expect(described_class::ROLES).to match_array(expected_roles)
|
|
end
|
|
end
|
|
end
|