Sha256: 5f7f5f88127812a706a7f1a155acaee4c27b8b02843c20729d68ed1d003e75f9

Contents?: true

Size: 1.07 KB

Versions: 13

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true
RSpec.shared_context "feature" do
  let!(:manifest_name) { raise NotImplementedError }
  let(:manifest) { Decidim.find_feature_manifest(manifest_name) }

  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

  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(:user) { create(:user, :confirmed, organization: organization) }

  before do
    Decidim::Admin::ParticipatoryProcessUserRole.create!(
      role: :admin,
      user: user,
      participatory_process: participatory_process
    )

    login_as user, scope: :user
  end

  def visit_feature_admin
    visit decidim_admin.manage_feature_path(participatory_process, feature)
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
decidim-dev-0.1.0 lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.1.0 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-dev-0.0.8.1 lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.0.8.1 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-dev-0.0.8 lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-dev-0.0.7 lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.0.7 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-dev-0.0.6 lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.0.6 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.0.5 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.0.4 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.0.3 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb
decidim-0.0.2 decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb