For some reason the factory create(:admin_user) is not working here, this new version works

This commit is contained in:
Luis Ramos
2020-09-04 14:19:50 +01:00
parent 8234ad0906
commit ecdba1fa4e

View File

@@ -726,7 +726,7 @@ describe Spree::Ability do
let(:manage_actions) { [:admin, :index, :read, :update, :bulk_update, :bulk_reset] }
describe "when admin" do
let(:user) { create(:admin_user) }
before { user.spree_roles << Spree::Role.find_or_create_by!(name: 'admin') }
it "should have permission" do
is_expected.to have_ability(manage_actions, for: variant_override)