Sha256: d1d552e1a9137eeaae8865c89a20f7b8888b20d0c6d30afb91625bc240c25b1f
Contents?: true
Size: 1.46 KB
Versions: 6
Compression:
Stored size: 1.46 KB
Contents
# frozen_string_literal: true RSpec.shared_context "feature" do let(:manifest) { Decidim.find_feature_manifest(manifest_name) } let(:user) { create :user, :confirmed, organization: organization } let!(:organization) { create(:organization) } let(:participatory_process) do create(:participatory_process, :with_steps, organization: organization) end let!(:feature) do create(:feature, manifest: manifest, participatory_process: participatory_process) end let!(:category) { create :category, participatory_process: participatory_process } let!(:scope) { create :scope, organization: organization } before do switch_to_host(organization.host) end def visit_feature page.visit decidim.feature_path(participatory_process, feature) end end RSpec.shared_context "feature admin" do include_context "feature" let(:current_feature) { feature } let(:user) do create :user, :admin, :confirmed, organization: organization end before do login_as user, scope: :user visit_feature_admin end def visit_feature_admin visit decidim_admin.manage_feature_path(participatory_process, feature) end end RSpec.shared_context "feature process admin" do include_context "feature admin" let(:user) do create :user, :process_admin, :confirmed, organization: organization, participatory_process: participatory_process end end
Version data entries
6 entries across 6 versions & 2 rubygems