Files
openfoodnetwork/spec/support/ability_helper.rb
2019-05-29 02:50:41 +08:00

17 lines
553 B
Ruby

module AbilityHelper
shared_examples "allows access to Enterprise Fee Summary" do
it "should be able to see link and read report" do
is_expected.to have_link_to_enterprise_fee_summary
is_expected.to have_direct_access_to_enterprise_fee_summary
end
def have_link_to_enterprise_fee_summary
have_ability([:enterprise_fee_summary], for: Spree::Admin::ReportsController)
end
def have_direct_access_to_enterprise_fee_summary
have_ability([:admin, :new, :create], for: :enterprise_fee_summary)
end
end
end